How do I plot this?

조회 수: 18 (최근 30일)
Marc Adams
Marc Adams 2018년 2월 23일
댓글: Star Strider 2018년 2월 23일
How do I plot the magnitude of a transfer function H?

채택된 답변

Star Strider
Star Strider 2018년 2월 23일
It depends on the Toolbox you’re using.
For a filter using the Signal Processing Toolbox, use the freqz (link) or freqs (link on the freqz page) functions.
For a control system using the Control System Toolbox, use the bode (link) function. Note that it is essentially impossible to change any of the plot characteristics using bode, so if you want to customise the plot, get the outputs from bode and plot them using the subplot function.
  댓글 수: 2
Marc Adams
Marc Adams 2018년 2월 23일
Is it possible to use [mag,phase,wout] = bode(H) and then Y=squeeze(mag), then plotting Y to plot magnitude in terms of frequency?
Star Strider
Star Strider 2018년 2월 23일
Yes. That is the only way I know of to do it.
To replicate the bode plot result, this works:
figure
subplot(2,1,1)
semilogx(wout, 20*log10(squeeze(mag)), '-r', 'LineWidth',2)
grid
subplot(2,1,2)
semilogx(wout, squeeze(phase), '-r', 'LineWidth',2)
grid

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Plot Customization에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by