How do I add a bode plot to an existing bode plot within a subplot in MATLAB?

45 次查看(过去 30 天)
When I create a set of subplots using BODE function and try to add a new system to the first subplot, the first set of bode plots disappears. This occurs for any of the LTIVIEW plottypes. For example:
subplot(211);
bode(sys1);
hold on;
subplot(212);
bode(sys2);
hold on;
subplot(211);
bode(sys3);
reproduces the behavior.

采纳的回答

MathWorks Support Team
To plot a new set of bode plots on the existing subplots, while preserving the previous plots, use the handle to the subplot. This will allow bode(sys1) and bode(sys3) on the same set of axes after producing a new subplot - bode(sys2) - between the first and third subplots. The following code illustrates this:
h1 = subplot(211);
bode(sys1);
hold on;
h2 = subplot(212);
bode(sys2);
hold on;
set(gcf,'currentaxes',h1);
bode(sys3);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Plot Customization 的更多信息

产品


版本

R14SP1

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by