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

📄 ptos_s.m

📁 FISMAT accommodates different arithmetic operators, fuzzification and defuzzification algorithm, imp
💻 M
字号:
function [ret,x0,str]=ptos_s(t,x,u,flag);%PTOS_S	is the M-file description of the SIMULINK system named PTOS_S.%	The block-diagram can be displayed by typing: PTOS_S.%%	SYS=PTOS_S(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 PTOS_S 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 PTOS_S with a FLAG of zero:%	[SIZES]=PTOS_S([],[],[],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',[100,100,600,400])     open_system(sys)end;set_param(sys,'algorithm',		'RK-45')set_param(sys,'Start time',	'0.0')set_param(sys,'Stop time',		'1.5')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/Sum',[sys,'/','Sum1'])set_param([sys,'/','Sum1'],...		'inputs','+-',...		'position',[90,95,110,115])add_block('built-in/Step Fcn',[sys,'/','Step Fcn'])set_param([sys,'/','Step Fcn'],...		'Time','0',...		'After','REF',...		'position',[20,90,40,110])add_block('built-in/Gain',[sys,'/','Gain1'])set_param([sys,'/','Gain1'],...		'Gain','0.5',...		'position',[320,100,340,120])add_block('built-in/Saturation',[sys,'/','Saturation'])set_param([sys,'/','Saturation'],...		'Lower Limit','-1',...		'Upper Limit','1',...		'position',[360,100,385,120])add_block('built-in/Gain',[sys,'/','Gain'])set_param([sys,'/','Gain'],...		'Gain','100',...		'position',[410,100,430,120])add_block('built-in/Integrator',[sys,'/','Integrator'])set_param([sys,'/','Integrator'],...		'position',[455,100,475,120])add_block('built-in/Integrator',[sys,'/','Integrator1'])set_param([sys,'/','Integrator1'],...		'position',[510,100,530,120])add_block('built-in/Outport',[sys,'/','Outport1'])set_param([sys,'/','Outport1'],...		'Port','2',...		'position',[220,35,240,55])add_block('built-in/Outport',[sys,'/','Outport2'])set_param([sys,'/','Outport2'],...		'position',[135,15,155,35])add_block('built-in/S-function',[sys,'/','fuzzy controller'])set_param([sys,'/','fuzzy controller'],...		'function name','fuzzy11',...		'parameters','''ptos_c'',Ts',...		'position',[130,95,180,115])add_block('built-in/Saturation',[sys,'/','Saturation1'])set_param([sys,'/','Saturation1'],...		'Lower Limit','-12',...		'Upper Limit','12',...		'position',[215,95,240,115])add_block('built-in/Outport',[sys,'/','Outport'])set_param([sys,'/','Outport'],...		'Port','3',...		'position',[125,215,145,235])add_block('built-in/Sum',[sys,'/','Sum'])set_param([sys,'/','Sum'],...		'inputs','+-',...		'position',[275,99,295,121])add_block('built-in/Note',[sys,'/',['ptos_s.m ',13,'Fuzzy Toolbox O.Wolkenhauer 21th.May 1994',13,'run ptos_d.m first']])set_param([sys,'/',['ptos_s.m ',13,'Fuzzy Toolbox O.Wolkenhauer 21th.May 1994',13,'run ptos_d.m first']],...		'position',[350,225,351,226])add_line(sys,[480,110;500,110])add_line(sys,[435,110;445,110])add_line(sys,[390,110;400,110])add_line(sys,[345,110;350,110])add_line(sys,[300,110;310,110])add_line(sys,[115,105;120,105])add_line(sys,[45,100;80,100])add_line(sys,[185,105;205,105])add_line(sys,[185,105;185,45;210,45])add_line(sys,[115,105;115,25;125,25])add_line(sys,[535,110;550,110;550,175;60,175;60,225;115,225])add_line(sys,[60,185;60,110;80,110])add_line(sys,[245,105;265,105])add_line(sys,[490,110;490,145;255,145;255,115;265,115])% 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);	endend

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -