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

조회 수: 38 (최근 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;

답변 (2개)

Walter Roberson
Walter Roberson 2024년 2월 13일
The most likely problem is if you do not have Control System Toolbox installed.

Paul
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))

카테고리

Help CenterFile Exchange에서 Signal Operations에 대해 자세히 알아보기

태그

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by