why am i getting the error "Incorrect number or types of inputs or outputs for function step."

35 views (last 30 days)
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;

Answers (2)

Walter Roberson
Walter Roberson on 13 Feb 2024
The most likely problem is if you do not have Control System Toolbox installed.

Paul
Paul on 13 Feb 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))

Tags

Products


Release

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!