Index exceeds the number of array elements (1) using transfer function
조회 수: 4 (최근 30일)
이전 댓글 표시
I don't understand what is wrong, it's frustrating.
% set up motor with initial conditions and properties
motor.timeConstant = 0.65; % [min]
motor.gain = 0.5; % [rpm/V]
% transfer function for the motor
s = tf('s');
TFmotor_OL = motor.gain / (motor.timeConstant*s +1);
ERROR message:
>> Tutorial3controllingplant
Index exceeds the number of array elements (1).
Error in Tutorial3controllingplant (line 6)
s = tf('s');
댓글 수: 0
채택된 답변
Amir RF
2020년 12월 10일
Dear Lucy,
I run your code and I did not get any errors. Your error may be in your earlier code line (where you define s).
Best,
댓글 수: 3
Amir RF
2020년 12월 10일
You can replace
s = tf('s');
TFmotor_OL = motor.gain / (motor.timeConstant*s +1);
with
TFmotor_OL = tf(motor.gain, [motor.timeConstant 1]);
This gives you the same result.
Best,
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Motor Drives에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!