?? bldblock.m
字號:
function [ret,x0,str]=bldblock(t,x,u,flag);
%BLDBLOCK is the M-file description of the SIMULINK system named BLDBLOCK.
% The block-diagram can be displayed by typing: BLDBLOCK.
%
% SYS=BLDBLOCK(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 BLDBLOCK 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 BLDBLOCK with a FLAG of zero:
% [SIZES]=BLDBLOCK([],[],[],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.
% 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.2)
if(0 == (nargin + nargout))
set_param(sys,'Location',[4,137,98,137])
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/Transfer Fcn',[sys,'/','Transfer Fcn'])
set_param([sys,'/','Transfer Fcn'],...
'Denominator','[1 ]',...
'position',[105,80,145,120])
add_block('built-in/Inport',[sys,'/','Input'])
set_param([sys,'/','Input'],...
'position',[25,90,45,110])
% Subsystem 'Simblock'.
new_system([sys,'/','Simblock'])
set_param([sys,'/','Simblock'],'Location',[-10,380,117,533])
set_param([sys,'/','Simblock'],...
'Mask Display','Return to The Control Kit',...
'Mask Type','',...
'Mask Dialogue','eval(''set_param(bname,''''Location'''',[0 0 0 0])'')',...
'Mask Translate','',...
'Mask Help','')
% Finished composite block 'Simblock'.
set_param([sys,'/','Simblock'],...
'hide name',0,...
'position',[30,176,155,215])
add_block('built-in/Outport',[sys,'/','Output'])
set_param([sys,'/','Output'],...
'position',[200,90,220,110])
add_line(sys,[50,100;95,100])
add_line(sys,[150,100;190,100])
% 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]=',sys,'(t,x,u,flag);'])
else
eval(['ret =', sys,'(t,x,u,flag);'])
end
else
[ret,x0,str] = feval(sys);
end
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -