error running sys=tf()

12 ビュー (過去 30 日間)
Kevin Puertas
Kevin Puertas 2021 年 9 月 9 日
編集済み: Kevin Puertas 2021 年 9 月 9 日
Hi,
i wa having trouble running sys=tf() resulting in an error and the line the code is in displaying in my command window. My code is below. Could you help me?
Y=10;
U= [1,3,10];
sys= tf(Y,U);
[y,t]=impulse(sys,5);
plot(t,y);
xlabel('Time (s)');
ylabel('Amplitude');
title('Problem 3');
grid on;
command window
Error in prob3 (line 3)
sys= tf(Y,U);
Resolved:
Apparently I didn't have the controls toolbox downloaded.
  2 件のコメント
Dave B
Dave B 2021 年 9 月 9 日
編集済み: Dave B 2021 年 9 月 9 日
This seems to run okay to me, is it possible that you have a tf variable defined? Or maybe a different tf function on your path (which tf should report matlab\toolbox\control\ctrlmodels)? clear all might be helpful. Or maybe you don't have this toolbox? I don't see what the error is, did MATLAB not give a little more info?
Y=10;
U= [1,3,10];
sys= tf(Y,U);
[y,t]=impulse(sys,5);
plot(t,y);
xlabel('Time (s)');
ylabel('Amplitude');
title('Problem 3');
grid on;
Kevin Puertas
Kevin Puertas 2021 年 9 月 9 日
You're right, so apparently i didn't have the controls toolbox.Thanks

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

回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by