Index exceeds the number of array elements (1) using transfer function

4 ビュー (過去 30 日間)
Lucy Beksinska
Lucy Beksinska 2020 年 12 月 10 日
コメント済み: Lucy Beksinska 2020 年 12 月 10 日
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');

採用された回答

Amir RF
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
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,
Lucy Beksinska
Lucy Beksinska 2020 年 12 月 10 日
Thank you for your help. I have also restarted the MATLAB app and the error has gone!
regards, lucy

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMotor Drives についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by