麻烦帮我找一下下面S函数的错误
Error: File: E:\MATLAB7\work\sfun_cylinder1.m Line: 30 Column: 17Unbalanced or misused parentheses or brackets
function=sfun_cylinder1(t,x,u,flag)
switch flag
case 0
=mdlInitializeSizes;
case 2
sys=mdlUpdates(t,x,u)
case 3
sys=mdlOutputs(x);
case{1,4,9}
sys=[];
otherwise
error(['Unhandled flag=',num2str(flag)]);
end;
function=mdlInitializeSizes
sizes=simsizes;
sizes.NumContStates=0;
sizes.NumDiscStates=1;
sizes.NumOutputs=1;
sizes.NumInputs=3;
sizes.DirFeedthrough=1;
sizes.NumSampleTimes=1;
sys=simsizes(sizes);
x0=[];
str=[];
ts=[-1 0];
function sys=mdlUpdates(x,u)
sys=u(1)*fst(u(2),u(3));
function sys=mdlOutputs(x)
sys=x;
function f=fst(u(2),u(3))
jj=rem(u(3),4*pi)
if jj==0
gg=u(2);
end
n=fix(u(3)/4*pi);
if u(3,1)>=0*n&j<4*pi*n
f=gg;
end
我想实现的功能是时间U1在4pi角度内只取U2在0点的初始值与变化的U1相乘后输出,但是运行出错,请大家帮我看看是那里错了
页:
[1]