⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sysm5.txt

📁 与上一个上传源码属同一问题的不同方面
💻 TXT
字号:
function [ret,x0,str,ts,xts]=am_sys5(t,x,u,flag);
%AM_SYS5	is the M-file description of the SIMULINK system named AM_SYS5.
%	The block-diagram can be displayed by typing: AM_SYS5.
%
%	SYS=AM_SYS5(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 AM_SYS5 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 AM_SYS5 with a FLAG of zero:
%	[SIZES]=AM_SYS5([],[],[],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',[38,87,554,385])
     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.00001')
set_param(sys,'Max step size', '0.001')
set_param(sys,'Relative error','1e-3')
set_param(sys,'Return vars',   '')

add_block('built-in/Note',[sys,'/',['传',13,'输',13,'信',13,'道']])
set_param([sys,'/',['传',13,'输',13,'信',13,'道']],...
		'Font Name','宋体',...
		'Font Size',12,...
		'position',[250,135,255,140])

add_block('built-in/Zero-Pole',[sys,'/',['Butterworth',13,'LP 滤波器']])
set_param([sys,'/',['Butterworth',13,'LP 滤波器']],...
		'Font Name','宋体',...
		'Font Size',12,...
		'Zeros','z',...
		'Poles','p',...
		'Gain','k',...
		'Mask Display','plot(20*log10(w),20*log10(abs(h)))',...
		'Mask Type','buttap')
set_param([sys,'/',['Butterworth',13,'LP 滤波器']],...
		'Mask Dialogue','Analog Butterworth low pass filter.\n\n(Requires Signal Processing Toolbox)|Cutoff frequency (rad/sec)|Order')
set_param([sys,'/',['Butterworth',13,'LP 滤波器']],...
		'Mask Translate','[z,p,k]=buttap(@2); z=@1*z; p=@1*p; k=real(prod(-p)); [num,den]=zp2tf(z,p,k); w=logspace(log10(@1/10),log10(10*@1),20); h=freqs(num,den,w); ')
set_param([sys,'/',['Butterworth',13,'LP 滤波器']],...
		'Mask Help','Butterworth low pass filter using MATLAB''s butter command.',...
		'Mask Entries','10\/4\/',...
		'position',[335,218,395,262])

add_block('built-in/Scope',[sys,'/',['载波与',13,'接收信号的乘积']])
set_param([sys,'/',['载波与',13,'接收信号的乘积']],...
		'Font Name','宋体',...
		'Font Size',12,...
		'Vgain','2.000000',...
		'Hgain','1.000000',...
		'Vmax','4.000000',...
		'Hmax','2.000000',...
		'Window',[58,249,387,411])
set_param([sys,'/',['载波与',13,'接收信号的乘积']],...
		'position',[445,140,475,170])

add_block('built-in/Note',[sys,'/','接收端'])
set_param([sys,'/','接收端'],...
		'Font Name','宋体',...
		'Font Size',12,...
		'position',[145,245,150,250])

add_block('built-in/Product',[sys,'/','乘法器1'])
set_param([sys,'/','乘法器1'],...
		'Font Name','宋体',...
		'Font Size',12,...
		'Mask Display','plot([0 1],[1 0],[0 1],[0 1]);',...
		'Mask Type','乘法器',...
		'Mask Dialogue','乘法器',...
		'position',[205,229,235,251])

add_block('built-in/Scope',[sys,'/','解调后信号波形'])
set_param([sys,'/','解调后信号波形'],...
		'Font Name','宋体',...
		'Font Size',12,...
		'Vgain','1.000000',...
		'Hgain','1.000000',...
		'Vmax','2.000000',...
		'Hmax','2.000000',...
		'Window',[248,314,579,454])
set_param([sys,'/','解调后信号波形'],...
		'position',[445,225,475,255])

add_block('built-in/Note',[sys,'/','Y(t) = X(t)*cos(Wc*t+p)'])
set_param([sys,'/','Y(t) = X(t)*cos(Wc*t+p)'],...
		'Font Name','宋体',...
		'Font Size',12,...
		'position',[335,60,340,65])

add_block('built-in/Scope',[sys,'/','调制后信号波形'])
set_param([sys,'/','调制后信号波形'],...
		'Font Name','宋体',...
		'Font Size',12,...
		'Vgain','2.000000',...
		'Hgain','1.000000',...
		'Vmax','4.000000',...
		'Hmax','2.000000',...
		'Window',[82,93,413,237],...
		'position',[445,70,475,100])

add_block('built-in/Note',[sys,'/','X(t)'])
set_param([sys,'/','X(t)'],...
		'Font Name','宋体',...
		'Font Size',12,...
		'position',[165,55,170,60])

add_block('built-in/Product',[sys,'/','乘法器'])
set_param([sys,'/','乘法器'],...
		'Font Name','宋体',...
		'Font Size',12,...
		'Mask Display','plot([0 1],[1 0],[0 1],[0 1]);',...
		'Mask Type','乘法器',...
		'Mask Dialogue','乘法器',...
		'position',[205,74,235,96])

add_block('built-in/Signal Generator',[sys,'/',['信号发生器',13,'频率(弧度//秒)']])
set_param([sys,'/',['信号发生器',13,'频率(弧度//秒)']],...
		'Font Name','宋体',...
		'Font Size',12,...
		'Peak','1.000000',...
		'Peak Range','5.000000',...
		'Freq','10.000000',...
		'Freq Range','50.000000',...
		'Wave','Sin')
set_param([sys,'/',['信号发生器',13,'频率(弧度//秒)']],...
		'Units','Rads',...
		'position',[70,63,115,97])

add_block('built-in/Note',[sys,'/','调制信号'])
set_param([sys,'/','调制信号'],...
		'Font Name','宋体',...
		'Font Size',12,...
		'position',[90,35,95,40])

add_block('built-in/Sine Wave',[sys,'/','载波'])
set_param([sys,'/','载波'],...
		'Font Name','宋体',...
		'Font Size',12,...
		'frequency','100',...
		'position',[80,130,100,150])

add_block('built-in/Note',[sys,'/',['cos ( Wc * t + p )',13,'Wc 载波角频率',13,'p 载波初始相位']])
set_param([sys,'/',['cos ( Wc * t + p )',13,'Wc 载波角频率',13,'p 载波初始相位']],...
		'Font Name','宋体',...
		'Font Size',12,...
		'position',[70,165,75,170])

add_block('built-in/Note',[sys,'/','同步调制//解调 AM 系统 ( 双边带 DSB )—— 原理'])
set_param([sys,'/','同步调制//解调 AM 系统 ( 双边带 DSB )—— 原理'],...
		'Font Name','宋体',...
		'Font Size',12,...
		'position',[260,10,265,15])

add_block('built-in/Note',[sys,'/','发送端'])
set_param([sys,'/','发送端'],...
		'Font Name','宋体',...
		'Font Size',12,...
		'position',[285,90,290,95])

add_block('built-in/Note',[sys,'/','已调 DSB 信号'])
set_param([sys,'/','已调 DSB 信号'],...
		'Font Name','宋体',...
		'Font Size',12,...
		'position',[365,85,370,90])
add_line(sys,[120,80;200,80])
add_line(sys,[105,140;140,140;140,90;200,90])
add_line(sys,[240,85;440,85])
add_line(sys,[240,240;330,240])
add_line(sys,[400,240;440,240])
add_line(sys,[140,140;140,245;200,245])
add_line(sys,[260,85;260,210;160,210;160,235;200,235])
add_line(sys,[310,240;310,155;440,155])

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 + -