What is wrong with this code?
信息
此问题已关闭。 请重新打开它进行编辑或回答。
显示 更早的评论
clear all;
n1=1;n2=25; den=[1 6 25];
figure
step=[n1,den];
title('Transfer function when numerator = 1')
figure
impulse=[n2,den];
title('Standard transfer function')
2 个评论
Image Analyst
2020-7-11
jake, what happened to your question?
Rena Berman
2020-7-22
(Answers Dev) Restored edit
回答(1 个)
Les Beckham
2020-7-10
If you are trying to plot the step and impulse responses of your transfer function you need to call step() and impulse() as functions instead of assigning values to them as variables.
I think it is now recommended to create a transfer function object rather than using the (num, den) arguments to step() and impulse(),
So, try this (I don't currently have the control system toolbox so I can't test this, but I think it should work).
n1 = 1;
n2 = 25;
den = [1 6 25];
figure
sys1 = tf(n1, den);
step(sys1);
title('Transfer function when numerator = 1')
figure
sys2 = tf(n2, den);
impulse(sys2);
title('Standard transfer function')
2 个评论
jake carl
2020-7-10
Les Beckham
2020-7-11
Do you have the control system toolbox? Please post the entire error message (everything in red).
此问题已关闭。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!