How do I plot this?

1 view (last 30 days)
Marc Adams
Marc Adams on 23 Feb 2018
Commented: Star Strider on 23 Feb 2018
How do I plot the magnitude of a transfer function H?

Accepted Answer

Star Strider
Star Strider on 23 Feb 2018
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.
Star Strider
Star Strider on 23 Feb 2018
Yes. That is the only way I know of to do it.
To replicate the bode plot result, this works:
semilogx(wout, 20*log10(squeeze(mag)), '-r', 'LineWidth',2)
semilogx(wout, squeeze(phase), '-r', 'LineWidth',2)

Sign in to comment.

More Answers (0)


Community Treasure Hunt

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

Start Hunting!