why am i getting the error "Incorrect number or types of inputs or outputs for function step."
35 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Salim Bajrai Husein Salim
el 13 de Feb. de 2024
Respondida: Walter Roberson
el 13 de Feb. de 2024
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 comentarios
Respuestas (2)
Walter Roberson
el 13 de Feb. de 2024
The most likely problem is if you do not have Control System Toolbox installed.
0 comentarios
Paul
el 13 de Feb. de 2024
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 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!