Info

この質問は閉じられています。 編集または回答するには再度開いてください。

What is wrong with this code?

1 回表示 (過去 30 日間)
jake carl
jake carl 2020 年 7 月 10 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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
Image Analyst 2020 年 7 月 11 日
jake, what happened to your question?
Rena Berman
Rena Berman 2020 年 7 月 22 日
(Answers Dev) Restored edit

回答 (1 件)

Les Beckham
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
jake carl 2020 年 7 月 10 日
Error in Untitled42 (line 5)
sys1 = tf(n1, den);
The same problem more than once
Les Beckham
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!

Translated by