简体   繁体   中英

Matlab Bode Plot Title Customisation - Turning Off Title and Input/Output

For the Bode plot below, I am trying to remove the title and the input/output line:

样品波特图

I have found methods to null the title line, but these do not 'collapse' it - which would make it pointless as my reason for removing the title is conserving the space it takes.

I also want to get entirely rid of the line detailing the input and output but I have not even managed to edit the contents there.

I have investigated the solution provided here and the Matlab help files for bode , bodeplot and bodeoptions .

What would be the appropriate code solution for achieving this?

For a MWE, try the below but as this applies generally, I am not sure this is useful for this question:

bode(tf([10000 0],[1 2.5 1.15]))

Save the gain and phase vectors and plot them out seperately with whatever title and x/y labels you would like:

[mag,phase,wout] = bode(tf([10000 0],[1 2.5 1.15]))

Here is an example of how to get a similar plot without a title:

% Plot 
% Old way
bode(tf([10000 0],[1 2.5 1.15]))

% new way
figure(2)
[mag,phase,wout] = bode(tf([10000 0],[1 2.5 1.15]))
ax1 = subplot(2,1,1) % gain plot
    plot(wout, 20*log10(mag(:)))
    set(gca, 'XScale', 'log')
    ylabel('Magnitude (dB)')
ax2 = subplot(2,1,2) % Phase plot 
    plot(wout, phase(:))
    set(gca, 'XScale', 'log')
    xlabel('Frequency (rad/s)')
    ylabel('Phase (deg)')

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