请高手帮我看看为什么矩阵不匹配?
我的程序是:security_a:
function dy = security(t,y)
dy = zeros(5,1);
global Eq Vo Xde Xqe delta
dy(1) = y(2);
dy(2) = 39.27*y(4)-0.625*y(2)-39.27*y(3);
dy(3) = ((Eq*Vo/Xde)*cos(delta)+(Vo^2*(Xde-Xqe)/(Xde*Xqe))*cos(2*delta))*y(2);
dy(4) = -5*y(4)+5*y(5);
dy(5) = -6.51*y(5)+6+6.51*(3.0546*y(2)-7.0815*y(3)+12.5842*y(4)+4.0329*y(5));
dy = [dy(1);dy(2);dy(3);dy(4);dy(5)];
security_b:
clear;
Eq=2.122;Vo=1;Xde=1.522;Xqe=1.206;delta=45.4;
tspan = [0,3];
y0 = [0;0;1.079;1.079;0];
[t,YY] = ode45('security_a',tspan,y0);
X1 = YY(:,1);
X2 = YY(:,2);
X3 = YY(:,3);
X4 = YY(:,4);
X5 = YY(:,5);
figure(1)
plot(X1,'r');
figure(2)
plot(X2,'r');
figure(3)
plot(X3,'r');
figure(4)
plot(X4,'r');
figure(5)
plot(X5,'r');
在执行的时候,系统错误提示为:
??? In an assignment A(I) = B, the number of elements in B and
I must be the same.
Error in ==> security_a at 6
dy(3) = ((Eq*Vo/Xde)*cos(delta)+(Vo^2*(Xde-Xqe)/(Xde*Xqe))*cos(2*delta))*y(2);
Error in ==> funfun\private\odearguments at 110
f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.
Error in ==> ode45 at 173
[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, ...
Error in ==> security_b at 5
[t,YY] = ode45('security_a',tspan,y0);
请问高手能不能帮我解决这个问题!非常感谢!