程序读不懂 谁帮读读
clearclose
A=[;;;];
B=[;[-1 2 0 0];;];
=eig(-B,A);
init=[;;;];
c=inv(V)*init;
for i=1:1:600
t=(i-1)*0.01;x1=0;x2=0;
for j=1:1:4
x1=x1+c(j)*V(1,j)*exp(D(j,j)*t);
x2=x2+c(j)*V(2,j)*exp(D(j,j)*t);
end
xt(i,1)=real(x1);xt(i,2)=real(x2);xt(i,3)=0;
end
plot(xt)
页:
[1]