1234435
代码说明:
用matlab 7.0编写的滑模变结构仿真的例子。(S-function for continuous state equation function [sys,x0,str,ts]=s_function(t,x,u,flag) switch flag, Initialization case 0, [sys,x0,str,ts]=mdlInitializeSizes Outputs case 3, sys=mdlOutputs(t,x,u) Unhandled flags case {2, 4, 9 } sys = [] Unexpected flags otherwise error([ Unhandled flag = ,num2str(flag)]) end mdlInitializeSizes function [sys,x0,str,ts]=mdlInitializeSizes sizes = simsizes sizes.NumContStates = 0 sizes.NumDiscStates = 0 sizes.NumOutputs = 3 sizes.NumInputs = 1 sizes.DirFeedthrough = 1 sizes.NumSampleTimes = 0 sys=simsizes(sizes) x0=[] str=[] ts=[] function sys=mdlOutputs(t,x,u) x11d=sin(pi*t/2) x21d=cos(pi*t) x31d=1 sys(1)=x11d sys(2)=x21d sys(3)=x31d )
下载说明:请别用迅雷下载,失败请重下,重下不扣分!