error running sys=tf()
12 ビュー (過去 30 日間)
古いコメントを表示
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
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;
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Downloads についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
