简体   繁体   中英

How to indicate a specific mad and phase value on bode plot given the freq in Matlab?

What I want to to is plot the bode plot of a transfer function

sys = tf([1],[1,1]);

then call

bode(sys);

but I also want to input particular frequencies where the bode plot marks the freq and display the value of mag and phase at that point.

So basically like a data point on the bode plot at the freq I input.

for example once I call bode(sys); the plot shows the (mag,freq) & (mag, phase) values at 2Khz, 120KHz etc

I would really aprreciate some help.

Thanks

There are 2 things I can think of. Both require you to calculate the value of the magnitude and phase for those particular frequency values and store them in arrays: Frequency, Magnitude, Phase.

Approach 1) Download this script: http://www.mathworks.in/matlabcentral/fileexchange/9973-gridxy-v2-2-feb-2008

and try this:

   bodemag(sys);
   hold on;
   gridxy(Frequency, Magnitude);

Approach 2)

   bodemag(sys);
   hold on;
   text(Frequency, Magnitude, num2str(Magnitude));

I dont know how to reference the phase plot. If you are able to reference the phase plot, then you should be able to do the same for that plot too. This link has some suggestions for phase only plot in matlab: http://www.mathworks.in/matlabcentral/newsreader/view_thread/247644

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM