在 matlab 波德图中更改 Y 轴限制
Change Y axis limit in matlab bode plot
我已经使用加速度计测量了频率响应。现在我想在 MATLAB 中使用 FRD 对象分析数据。
当我尝试使用 MATLAB 的 bodeplot 函数绘制频率响应并使用 ylim 更改幅度图的 y 轴限制时,幅度图和相位图的 y 轴限制都会发生变化。
有没有办法只改变y轴的幅度限制,同时保持y轴的相位限制不变?
编辑:
这个问题与图表的评估或它们的解释无关,而是关于改变波德图中特定轴的限制。我在 MATLAB 中寻找特定的 function/command。
kpg987完美解答了我的问题
这可以在创建波德图句柄时完成。顺便说一下,MATLAB 已经在这里提供了一个很好的例子:https://www.mathworks.com/help/control/ug/customizing-response-plots-from-the-command-line.html
我提供了一个多输入多输出 (MIMO) 系统来说明其工作原理。假设您已经有一个名为 sys_Orig
的系统
Handleplot=bodeplot(sys_Orig); %create a handle
p=getoptions(Handleplot); %get the handle options
看看我们原来的伯德图:
假设我现在想将左上图的 y 轴范围从 [-50 50] 更改为 [-100 50],我该怎么做?在命令行中输入 p 以获得可调绘图参数的峰值:
p =
Title: [1x1 struct]
XLabel: [1x1 struct]
YLabel: [1x1 struct]
TickLabel: [1x1 struct]
Grid: 'off'
GridColor: [0.1500 0.1500 0.1500]
XLim: {2x1 cell}
XLimMode: {2x1 cell}
YLim: {4x1 cell}
YLimMode: {4x1 cell}
IOGrouping: 'none'
InputLabels: [1x1 struct]
OutputLabels: [1x1 struct]
InputVisible: {2x1 cell}
OutputVisible: {2x1 cell}
FreqUnits: 'rad/s'
FreqScale: 'log'
MagUnits: 'dB'
MagScale: 'linear'
MagVisible: 'on'
MagLowerLimMode: 'auto'
MagLowerLim: 0
PhaseUnits: 'deg'
PhaseVisible: 'on'
PhaseWrapping: 'off'
PhaseMatching: 'off'
PhaseMatchingFreq: 0
PhaseMatchingValue: 0
ConfidenceRegionNumberSD: 1
注意 Ylim 是一个 4x1 单元格。 4 是因为我们有四行地块。
索引您要更改的行。在这种情况下,它是我们的顶行,第 1 行:
p.Ylim{1}= [-100 50]; %Setting the y-axis limits
setoptions(Handleplot,p); %update your plot
我已经使用加速度计测量了频率响应。现在我想在 MATLAB 中使用 FRD 对象分析数据。
当我尝试使用 MATLAB 的 bodeplot 函数绘制频率响应并使用 ylim 更改幅度图的 y 轴限制时,幅度图和相位图的 y 轴限制都会发生变化。
有没有办法只改变y轴的幅度限制,同时保持y轴的相位限制不变?
编辑: 这个问题与图表的评估或它们的解释无关,而是关于改变波德图中特定轴的限制。我在 MATLAB 中寻找特定的 function/command。
kpg987完美解答了我的问题
这可以在创建波德图句柄时完成。顺便说一下,MATLAB 已经在这里提供了一个很好的例子:https://www.mathworks.com/help/control/ug/customizing-response-plots-from-the-command-line.html
我提供了一个多输入多输出 (MIMO) 系统来说明其工作原理。假设您已经有一个名为 sys_Orig
Handleplot=bodeplot(sys_Orig); %create a handle
p=getoptions(Handleplot); %get the handle options
看看我们原来的伯德图:
假设我现在想将左上图的 y 轴范围从 [-50 50] 更改为 [-100 50],我该怎么做?在命令行中输入 p 以获得可调绘图参数的峰值:
p =
Title: [1x1 struct]
XLabel: [1x1 struct]
YLabel: [1x1 struct]
TickLabel: [1x1 struct]
Grid: 'off'
GridColor: [0.1500 0.1500 0.1500]
XLim: {2x1 cell}
XLimMode: {2x1 cell}
YLim: {4x1 cell}
YLimMode: {4x1 cell}
IOGrouping: 'none'
InputLabels: [1x1 struct]
OutputLabels: [1x1 struct]
InputVisible: {2x1 cell}
OutputVisible: {2x1 cell}
FreqUnits: 'rad/s'
FreqScale: 'log'
MagUnits: 'dB'
MagScale: 'linear'
MagVisible: 'on'
MagLowerLimMode: 'auto'
MagLowerLim: 0
PhaseUnits: 'deg'
PhaseVisible: 'on'
PhaseWrapping: 'off'
PhaseMatching: 'off'
PhaseMatchingFreq: 0
PhaseMatchingValue: 0
ConfidenceRegionNumberSD: 1
注意 Ylim 是一个 4x1 单元格。 4 是因为我们有四行地块。 索引您要更改的行。在这种情况下,它是我们的顶行,第 1 行:
p.Ylim{1}= [-100 50]; %Setting the y-axis limits
setoptions(Handleplot,p); %update your plot