我想在某些控制系統中進行開環分析。數據可能不超過2個維度!
首先,我分析PT1,並能正常工作!
% Assigning the variables
Ksys = 0.8667;
T1 = 1.65;
% PT1 modeling
num = [0 Ksys];
den = [T1 1];
PT1 = tf(num, den);
% Step Response
t = 0:0.01:10;
y = 4.5 * step(PT1, t);
% Plotting
plot(t, y);
ylim([0, 6]);
但是,當我分析高階廠:
% Assigning the variables
Ksys = 0.8667;
Tc = 1.65;
Td = 0.25;
% PTn modeling
num = [0 Ksys];
den = [Tc 1];
PT1 = tf(num, den);
sh = pade(Td, 2);
PTn = PT1 * sh;
% Step Response
t = 0:0.01:10;
y = 4.5 * step(PTn, t);
% Plotting
plot(t, y);
ylim([0, 6]);
它提供了以下錯誤:
??? Error using ==> plot
Data may not have more than 2 dimensions
Error in ==> TestProject at 25
plot(t, y);
我怎樣才能解決這個問題呢?
'size(t)'和'size(y)'的輸出是什麼? – abcd 2011-05-25 06:26:18
'size(t)= 1 1001' 'size(y)= 1001 1 3' – 2011-05-25 06:28:30