why am i getting the error "Incorrect number or types of inputs or outputs for function step."
35 次查看(过去 30 天)
显示 更早的评论
My code:
Kp5 = 10.1;
num5 = [2*Kp5];
den5 = [0.4 4.1 (1+2*Kp5)];
Ki6 = 0.0611;
num6 = 2*Ki6;
den6 = [0.4 4.1 1 2*Ki6];
Kp7 = 9.97;
num7 = 2*Kp7*[1 0.3];
den7 = [0.4 4.1 (1+2*Kp7) 0.6*Kp7];
figure;
step(num5,den5);
hold on;
step(num6,den6);
step(num7,den7);
grid on;
0 个评论
回答(2 个)
Walter Roberson
2024-2-13
The most likely problem is if you do not have Control System Toolbox installed.
0 个评论
Paul
2024-2-13
Hi Salim
Your code runs fine here. What version of Matlab are you using?
I just changed the code to make separate plots intead of overlaying them all on one plot
Kp5 = 10.1;
num5 = [2*Kp5];
den5 = [0.4 4.1 (1+2*Kp5)];
Ki6 = 0.0611;
num6 = 2*Ki6;
den6 = [0.4 4.1 1 2*Ki6];
Kp7 = 9.97;
num7 = 2*Kp7*[1 0.3];
den7 = [0.4 4.1 (1+2*Kp7) 0.6*Kp7];
figure;
step(num5,den5);
%hold on;
figure
step(num6,den6);
figure
step(num7,den7);
%grid on;
Having said that, those calls to step are using obsolete functionality. Instead use tf, ss, or zpk objects, like this
figure
step(tf(num5,den5))
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!