📄 nlconcd.m
字号:
function [ret,x0,str,ts,xts]=nlconcd(t,x,u,flag);
%NLCONCD is the M-file description of the SIMULINK system named NLCONCD.
% NLCONCD has a the following characteristics:
% 0 continuous states
% 2 discrete states
% 3 outputs
% 2 inputs
% has direct feedthrough
% 1 sample times
%
% The block-diagram can be displayed by typing: NLCONCD.
%
% SYS=NLCONCD(T,X,U,FLAG) returns depending on FLAG certain
% system values given time point, T, current state vector, X,
% and input vector, U.
% FLAG is used to indicate the type of output to be returned in SYS.
%
% Setting FLAG=1 causes NLCONCD to return state derivatives, FLAG=2
% discrete states, FLAG=3 system outputs and FLAG=4 next sample
% time. For more information and other options see SFUNC.
%
% Calling NLCONCD with a FLAG of zero:
% [SIZES]=NLCONCD([],[],[],0), returns a vector, SIZES, which
% contains the sizes of the state vector and other parameters.
% SIZES(1) number of states
% SIZES(2) number of discrete states
% SIZES(3) number of outputs
% SIZES(4) number of inputs
% SIZES(5) number of roots (currently unsupported)
% SIZES(6) direct feedthrough flag
% SIZES(7) number of sample times
%
% For the definition of other parameters in SIZES, see SFUNC.
% See also, TRIM, LINMOD, LINSIM, EULER, RK23, RK45, ADAMS, GEAR.
% Note: This M-file is only used for saving graphical information;
% after the model is loaded into memory an internal model
% representation is used.
% the system will take on the name of this mfile:
sys = mfilename;
new_system(sys)
simver(1.3)
if (0 == (nargin + nargout))
set_param(sys,'Location',[100,100,759,319])
open_system(sys)
end;
set_param(sys,'algorithm', 'RK-45')
set_param(sys,'Start time', '0.0')
set_param(sys,'Stop time', '999999')
set_param(sys,'Min step size', '0.0001')
set_param(sys,'Max step size', '10')
set_param(sys,'Relative error','1e-3')
set_param(sys,'Return vars', '')
add_block('built-in/Inport',[sys,'/','Inport'])
set_param([sys,'/','Inport'],...
'position',[25,15,45,35])
add_block('built-in/Unit Delay',[sys,'/','Unit Delay1'])
set_param([sys,'/','Unit Delay1'],...
'hide name',0,...
'position',[175,122,225,138])
add_block('built-in/Logical Operator',[sys,'/',['Logical',13,'Operator1']])
set_param([sys,'/',['Logical',13,'Operator1']],...
'ForeGround',4,...
'hide name',0,...
'Operator','XOR',...
'position',[270,105,315,140])
add_block('built-in/Inport',[sys,'/','Inport1'])
set_param([sys,'/','Inport1'],...
'ForeGround',3,...
'Port','2',...
'position',[25,60,45,80])
add_block('built-in/Outport',[sys,'/','Outport1'])
set_param([sys,'/','Outport1'],...
'Port','2',...
'position',[590,60,610,80])
add_block('built-in/Outport',[sys,'/','Outport'])
set_param([sys,'/','Outport'],...
'position',[585,15,605,35])
add_block('built-in/Outport',[sys,'/','Outport2'])
set_param([sys,'/','Outport2'],...
'Port','3',...
'position',[590,115,610,135])
add_block('built-in/Logical Operator',[sys,'/',['Logical',13,'Operator']])
set_param([sys,'/',['Logical',13,'Operator']],...
'ForeGround',4,...
'hide name',0,...
'Operator','XOR',...
'Number of Input Ports','3',...
'position',[110,102,145,158])
add_block('built-in/Logical Operator',[sys,'/',['Logical',13,'Operator3']])
set_param([sys,'/',['Logical',13,'Operator3']],...
'orientation',2,...
'ForeGround',4,...
'hide name',0,...
'Operator','AND',...
'position',[180,155,230,190])
add_block('built-in/Unit Delay',[sys,'/','Unit Delay2'])
set_param([sys,'/','Unit Delay2'],...
'hide name',0,...
'position',[390,117,440,133])
add_line(sys,[50,70;585,70])
add_line(sys,[50,25;580,25])
add_line(sys,[50,70;60,70;60,130;105,130])
add_line(sys,[150,130;170,130])
add_line(sys,[230,130;265,130])
add_line(sys,[240,25;240,115;265,115])
add_line(sys,[320,125;330,125;330,165;235,165])
add_line(sys,[175,175;85,175;85,150;105,150])
add_line(sys,[330,125;385,125])
add_line(sys,[445,125;585,125])
add_line(sys,[510,125;510,180;235,180])
add_line(sys,[70,25;70,110;105,110])
drawnow
% Return any arguments.
if (nargin | nargout)
% Must use feval here to access system in memory
if (nargin > 3)
if (flag == 0)
eval(['[ret,x0,str,ts,xts]=',sys,'(t,x,u,flag);'])
else
eval(['ret =', sys,'(t,x,u,flag);'])
end
else
[ret,x0,str,ts,xts] = feval(sys);
end
else
drawnow % Flash up the model and execute load callback
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -