我最近在學MATLAB有學到步階響應
但是我寫程式寫式寫到sys=ss(A,B,C,D)就出現錯誤
程式如下:
>> wn=1.5;
>> zeta=0.5;
>> A=[0 1;-wn^2 -2*wn*zeta];
B=[0 wn^2];
>> C=[1 0];
>> D=0;
>> sys=ss(A,B,C,D);
>> step(A,B,C,D)
錯誤(紅色):
Error using ss (line 331)
The values of the "a" and "b" properties must be matrices with the same
number of rows.
Error in step (line 113)
sys = ss(a,b,c,d);
但是我參考其他範例就沒這問題
範例:
a=[-0.23 –1.32;1.32 0];
b=[1;0];
c=[2.43 3.92];
d=0;
impulse(a,b,c,d);
他是用impulse就沒出現錯誤
為甚麼會這樣?我想了很久了,謝謝。