필터 지우기
필터 지우기

Multiple Bode plots on same graph, how to plot phase ?

조회 수: 29 (최근 30일)
ata
ata 2013년 5월 20일
댓글: Patricia Darling 2016년 3월 1일
Hello,
My question has already been posted, but I'm having some trouble...
I'm trying to plot 2 bode plots on the same figure. One of the plots has a transfer function, the other not. So I use this command:
semilogx(x,y), hold on
bode(sys, 'r')
On this way I get 2 curves on the amplitude-plot, to this point all right. I'm looking to also add a second curve on the phase-plot. I tried using subplot(2,1,2), but it doesn't work...
Does anyone can tell me how to add this second phase-cure?
Thanks, Ata
  댓글 수: 2
José-Luis
José-Luis 2013년 5월 20일
Could you post an example of what you'd like and what you actually get? It doesn't work is not a very helpful description. Have you tried
hold on
ata
ata 2013년 5월 20일
This is wat I get for the moment : http://puu.sh/2XksL.png
I'd like to also plot a second blue curve in the phase-plot. This curve will be created from discrete data.
And yes I tried hold on after the subplot-command, but the graphic is totally replaced by the bode plot (i.e. the blue curve is not present).

댓글을 달려면 로그인하십시오.

채택된 답변

David Sanchez
David Sanchez 2013년 5월 20일
[mag_A phase_A] = bode(sys_A,W);
[mag_B phase_B] = bode(sys_B,W);
subplot(2,1,1)
semilogx(W,mag_A);hold on
semilogx(W,mag_B);hold off
subplot(2,1,2)
semilogx(W,phase_A);hold on
semilogx(W,phase_B);hold off
  댓글 수: 3
ata
ata 2013년 5월 20일
Oh right, I got it.
Here is the code I used:
[mag_A phase_A W] = bode(sys)
subplot(2,1,1)
semilogx(W,mag_A(:,:)); hold on
semilogx(x,y); hold off
and similar for the second subplot
Patricia Darling
Patricia Darling 2016년 3월 1일
Thank you! This works!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Response Computation and Visualization에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by