Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

What is wrong with this code?

조회 수: 3 (최근 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