error running sys=tf()
11 views (last 30 days)
Show older comments
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 Comments
Dave B
on 9 Sep 2021
Edited: Dave B
on 9 Sep 2021
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;
Answers (0)
See Also
Categories
Find more on Downloads in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!