MATLAB Answers

Why can't I get the same plot as the official tutorial video? (non-minimal phase system)

26 views (last 30 days)
He Li
He Li on 13 Dec 2020
Commented: He Li on 15 Dec 2020
The link is: https://youtu.be/jGEkmDRsq_M
2:41 I use the same code as Brian, But the bode plot are different. So maybe I am wrong? or the video uses wrong figure? I can't figure it out.
Can anyone help me check it?
>>G=tf([1 2],[1 3 1]);G_delay=tf([1 2],[1 3 1],'InputDelay', 1);G_RHP_zero=tf([-1 2],[1 3 1]);bode(G);hold all; bode(G_delay);bode(G_RHP_zero)
4:18 The code in the video reports an error.
>>step(G,G_delay,G_RHP_zero)
Error using DynamicSystem/step (line 95)Plots must be of the same type and size to be superimposed.

  0 Comments

Sign in to comment.

Accepted Answer

Paul
Paul on 13 Dec 2020
I get the same Bode plots. What's different about yours? Also, you can do this with one Bode command
bode(G,G_RHP_zero,G_delay)
To deal with the error on the step command, you need to either "hold off" the axes with the Bode plots, or do clf, or open a new figure for the step response plots.

  3 Comments

Paul
Paul on 14 Dec 2020
The plots in the video have the phase wrapped to be between +-180 deg. To get the same in your plot
  1. Right click in the gain or the phase plot
  2. Select "Properties"
  3. Options tab
  4. Check "Wrap phase"

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!