Matlab 波德图标题自定义 - 关闭标题和 Input/Output
Matlab Bode Plot Title Customisation - Turning Off Title and Input/Output
对于下面的伯德图,我试图删除标题和 input/output 行:
我找到了使标题行无效的方法,但这些方法没有 'collapse' 它 - 这会使它变得毫无意义,因为我删除标题的原因是要保留它需要的 space。
我也想完全删除详细说明输入和输出的行,但我什至没有设法编辑那里的内容。
我已经研究了 and the Matlab help files for bode, bodeplot and bodeoptions 提供的解决方案。
实现此目标的适当代码解决方案是什么?
对于 MWE,请尝试以下操作,但由于这通常适用,我不确定这对这个问题是否有用:
bode(tf([10000 0],[1 2.5 1.15]))
保存增益和相位向量,并使用您想要的任何标题和 x/y 标签分别绘制它们:
[mag,phase,wout] = bode(tf([10000 0],[1 2.5 1.15]))
下面是一个如何获得没有标题的相似情节的例子:
% 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)')
对于下面的伯德图,我试图删除标题和 input/output 行:
我找到了使标题行无效的方法,但这些方法没有 'collapse' 它 - 这会使它变得毫无意义,因为我删除标题的原因是要保留它需要的 space。
我也想完全删除详细说明输入和输出的行,但我什至没有设法编辑那里的内容。
我已经研究了
实现此目标的适当代码解决方案是什么?
对于 MWE,请尝试以下操作,但由于这通常适用,我不确定这对这个问题是否有用:
bode(tf([10000 0],[1 2.5 1.15]))
保存增益和相位向量,并使用您想要的任何标题和 x/y 标签分别绘制它们:
[mag,phase,wout] = bode(tf([10000 0],[1 2.5 1.15]))
下面是一个如何获得没有标题的相似情节的例子:
% 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)')