Function 'subindex' is not defined for values of class 'ss' of 'zpk'

조회 수: 1 (최근 30일)
Barkat
Barkat 2017년 10월 26일
편집: Walter Roberson 2017년 10월 26일
Dear All
I am following MATLAB tutorial in Mathworks "Designing PID for Disturbance Rejection with PID Tuner" While following this tutorial, I got the following error in the picture. and another error is
"Function 'subsindex' is not defined for values of class 'zpk'."
The errors occurred after the following commands
G = zpk(-5,[-1 -2 -3 -4],6,'OutputDelay',1);
G.InputName = 'u';
G.OutputName = 'y';
C = pid(0.64362,0.30314);
C.InputName = 'e';
C.OutputName = 'u';
b = 0.7;
% The following code constructs an ISA-PID from F and C
F = tf([b*C.Kp C.Ki],[C.Kp C.Ki]);
F.InputName = 'r';
F.OutputName = 'uf';
Sum = sumblk('e','uf','y','+-');
ISAPID = connect(C,F,Sum,{'r','y'},'u');
tf(ISAPID)
% Closed-loop system with PI controller for reference tracking
sys1 = feedback(G*C,1);
% Closed-loop system with ISA-PID controller
sys2 = connect(ISAPID,G,{'r','u'},'y');
% Compare responses
step(sys1,'r-',sys2(1),'b.');
legend('show','location','southeast')
title('Reference Tracking')
Can anyone guide me how to remove these errors ?
Thank you

채택된 답변

Steven Lord
Steven Lord 2017년 10월 26일
If you run these lines of code one by one, on which line does the error occur?
My suspicion is that you have created a variable named connect if the error occurs on the line of code where you're trying to call the connect function.
  댓글 수: 1
Barkat
Barkat 2017년 10월 26일
Thank you, Sir, The response is now correct and the codes are working.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 PID Controller Tuning에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by