The magnitude in Bode plot differs from the mag values returned with: [mag,phase,wout] = bode(G,win)
50 views (last 30 days)
Show older comments
Santiago Aljure
on 19 Nov 2019
Commented: Star Strider
on 19 Nov 2019
Why does the bode plot show a different value in magnitude when compared with the value returned in "mag", in [mag,phase,wout] = bode(G,win)?
%Code where it happened:
num = [67.22,85.48];
den = [0.171,1,0,0];
G = tf(num,den);
[mag,phase,wout]=bode(G,2.74) %The mag value for frequency 2.74 is taken from here. Returns mag = 24.4912.
bode(G) %The magnitude value to compare (stored in the mag variable) is taken visually from the plot. Shows mag = 27.8 (as shown in picture below)
Clearly 24.4912 is different from 27.8. Am I doing something wrong? I'm using Matlab R2019b.
Thank you.
0 Comments
Accepted Answer
Star Strider
on 19 Nov 2019
The output magnitudes are not in decibels. If you instead use:
mag_dB = 20*log10(mag)
the result is:
mag_dB =
27.7802
that looks suspicioously like 27.8 dB.
2 Comments
More Answers (0)
See Also
Categories
Find more on Plot Customization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!