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;
댓글 수: 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!