?? yjsh.m
字號(hào):
function [ret,x0,str,ts,xts]=yjsh(t,x,u,flag);
%YJSH is the M-file description of the SIMULINK system named YJSH.
% The block-diagram can be displayed by typing: YJSH.
%
% SYS=YJSH(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 YJSH 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 YJSH with a FLAG of zero:
% [SIZES]=YJSH([],[],[],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',[6,95,353,417])
open_system(sys)
end;
set_param(sys,'algorithm', 'RK-45')
set_param(sys,'Start time', '0.0')
set_param(sys,'Stop time', '30')
set_param(sys,'Min step size', '0.0001')
set_param(sys,'Max step size', '0.1')
set_param(sys,'Relative error','1e-3')
set_param(sys,'Return vars', '')
add_block('built-in/Transfer Fcn',[sys,'/','一階系統(tǒng)2'])
set_param([sys,'/','一階系統(tǒng)2'],...
'Font Name','宋體',...
'Denominator','[R*C 1]')
set_param([sys,'/','一階系統(tǒng)2'],...
'Mask Display','plot([0 2 2 2],[2 2 1.5 2.5],[2 6],[2.5 2.5],[2 6],[1.5 1.5],[6 6],[2.5 1.5],[6 11],[2 2],[8 8 6 10],[2 0 0 0],[6 10],[-1 -1],[8 8 7 9],[-1 -3 -3 -3]);',...
'Mask Type','積分')
set_param([sys,'/','一階系統(tǒng)2'],...
'Mask Dialogue','積分|電容量(法):|電阻值(歐姆):',...
'Mask Translate','C=@1;R=@2;',...
'Mask Entries','0.01\/10\/',...
'position',[100,240,170,290])
% Subsystem ['頻譜分析儀1',13,'(系統(tǒng)1的頻譜)'].
new_system([sys,'/',['頻譜分析儀1',13,'(系統(tǒng)1的頻譜)']])
set_param([sys,'/',['頻譜分析儀1',13,'(系統(tǒng)1的頻譜)']],'Location',[0,0,371,185])
add_block('built-in/Mux',[sys,'/',['頻譜分析儀1',13,'(系統(tǒng)1的頻譜)/Mux']])
set_param([sys,'/',['頻譜分析儀1',13,'(系統(tǒng)1的頻譜)/Mux']],...
'inputs','2',...
'position',[145,71,175,104])
add_block('built-in/Inport',[sys,'/',['頻譜分析儀1',13,'(系統(tǒng)1的頻譜)/system output']])
set_param([sys,'/',['頻譜分析儀1',13,'(系統(tǒng)1的頻譜)/system output']],...
'Port','2',...
'position',[55,110,75,130])
add_block('built-in/S-Function',[sys,'/',['頻譜分析儀1',13,'(系統(tǒng)1的頻譜)/S-function block',13,'which calls M-file']])
set_param([sys,'/',['頻譜分析儀1',13,'(系統(tǒng)1的頻譜)/S-function block',13,'which calls M-file']],...
'function name','sfuntf',...
'parameters','fftpts,npts,HowOften,offset,ts,0',...
'position',[250,72,295,108])
add_block('built-in/Inport',[sys,'/',['頻譜分析儀1',13,'(系統(tǒng)1的頻譜)/system input']])
set_param([sys,'/',['頻譜分析儀1',13,'(系統(tǒng)1的頻譜)/system input']],...
'position',[55,30,75,50])
add_line([sys,'/',['頻譜分析儀1',13,'(系統(tǒng)1的頻譜)']],[80,120;110,120;110,95;140,95])
add_line([sys,'/',['頻譜分析儀1',13,'(系統(tǒng)1的頻譜)']],[80,40;110,40;110,80;140,80])
add_line([sys,'/',['頻譜分析儀1',13,'(系統(tǒng)1的頻譜)']],[180,90;245,90])
set_param([sys,'/',['頻譜分析儀1',13,'(系統(tǒng)1的頻譜)']],...
'Mask Display','plot(0,0,100,100,[11,93,93,11,11],[90,90,40,40,90],[90,80,72,64,55,45,41,36,20],[50,50,52,59,67,75,78,80,80])',...
'Mask Type','Spectrum analyzer.')
set_param([sys,'/',['頻譜分析儀1',13,'(系統(tǒng)1的頻譜)']],...
'Mask Dialogue','Spectrum analyser using graph window.\nHook input 1 to system input.\nHook input 2 to system output.|Length of buffer:|Number of points for fft:|Plot after how many points:|Sample time:')
set_param([sys,'/',['頻譜分析儀1',13,'(系統(tǒng)1的頻譜)']],...
'Mask Translate','npts=@1; fftpts=@2; HowOften=@3; ts=@4(1); if length(@4) > 1, offset = @4(2), else, offset = 0; end')
set_param([sys,'/',['頻譜分析儀1',13,'(系統(tǒng)1的頻譜)']],...
'Mask Help','Hook the system''s input to the first port of this block and the system''s output to second port. Results are displayed as the frequency response of this system. Use signals with high harmonic content for best results. ')
set_param([sys,'/',['頻譜分析儀1',13,'(系統(tǒng)1的頻譜)']],...
'Mask Entries','512\/1024\/100\/0.05\/')
% Finished composite block ['頻譜分析儀1',13,'(系統(tǒng)1的頻譜)'].
set_param([sys,'/',['頻譜分析儀1',13,'(系統(tǒng)1的頻譜)']],...
'Font Name','宋體',...
'Drop Shadow',4,...
'position',[215,97,245,133])
add_block('built-in/Transfer Fcn',[sys,'/','一階系統(tǒng)1'])
set_param([sys,'/','一階系統(tǒng)1'],...
'Font Name','宋體',...
'Numerator','[R*C 0]',...
'Denominator','[R*C 1]')
set_param([sys,'/','一階系統(tǒng)1'],...
'Mask Display','plot([0 2 2 2],[2 2 0 4],[3 3 3 8],[0 4 2 2],[6 6 5.5 6.5],[2 0 0 0],[5.5 5.5],[0 -4],[6.5 6.5],[0 -4],[5.5 6.5 6 6],[-4 -4 -4 -5.5],[5.5 6.5],[-5.5 -5.5]);',...
'Mask Type','微分')
set_param([sys,'/','一階系統(tǒng)1'],...
'Mask Dialogue','微分|電容量(法):|電阻值(歐姆):',...
'Mask Translate','C=@1;R=@2;',...
'Mask Entries','0.01\/10\/',...
'position',[95,141,165,189])
% Subsystem '方波信號(hào)'.
new_system([sys,'/','方波信號(hào)'])
set_param([sys,'/','方波信號(hào)'],'Location',[158,441,759,682])
add_block('built-in/Unit Delay',[sys,'/','方波信號(hào)/Unit Delay1'])
set_param([sys,'/','方波信號(hào)/Unit Delay1'],...
'orientation',2,...
'Sample time','[Ts,st2]',...
'x0','ini',...
'position',[140,165,190,185])
add_block('built-in/Unit Delay',[sys,'/','方波信號(hào)/Unit Delay'])
set_param([sys,'/','方波信號(hào)/Unit Delay'],...
'orientation',2,...
'Sample time','[Ts,st1]',...
'position',[145,75,195,95])
add_block('built-in/Constant',[sys,'/','方波信號(hào)/Constant'])
set_param([sys,'/','方波信號(hào)/Constant'],...
'position',[25,30,45,50])
add_block('built-in/Sum',[sys,'/','方波信號(hào)/Sum'])
set_param([sys,'/','方波信號(hào)/Sum'],...
'hide name',0,...
'inputs','+-',...
'position',[135,35,155,55])
add_block('built-in/Sum',[sys,'/','方波信號(hào)/Sum1'])
set_param([sys,'/','方波信號(hào)/Sum1'],...
'hide name',0,...
'inputs','+-',...
'position',[130,120,150,140])
add_block('built-in/Relational Operator',[sys,'/',['方波信號(hào)/Relational',13,'operator']])
set_param([sys,'/',['方波信號(hào)/Relational',13,'operator']],...
'hide name',0,...
'position',[370,102,400,133])
add_block('built-in/Clock',[sys,'/','方波信號(hào)/Clock1'])
set_param([sys,'/','方波信號(hào)/Clock1'],...
'hide name',0,...
'position',[295,100,315,120])
add_block('built-in/Constant',[sys,'/','方波信號(hào)/Constant1'])
set_param([sys,'/','方波信號(hào)/Constant1'],...
'Value','stt',...
'position',[295,149,320,171])
add_block('built-in/Logical Operator',[sys,'/',['方波信號(hào)/Logical',13,'Operator']])
set_param([sys,'/',['方波信號(hào)/Logical',13,'Operator']],...
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -