【问题标题】:creating multiple subplots simultaneously同时创建多个子图
【发布时间】:2013-07-06 04:28:29
【问题描述】:

如何同时创建多个子图, 例如,我有

while i < 4
   kS = kS_array(i);
   bS = bS_array(i);
   sim('sim_1');
   subplot(3,1,i), plot(time,x);
   %now i want to create another subplot for F(force wrt time)
   % something like subplot_2(3,1,i), plot(time, F)
   i=i+1;
end

我正在用不同的变量模拟 simulink 模型并绘制它们。 我是初学者,所以我想知道是否有其他有效的方法来做到这一点。

【问题讨论】:

  • 如果我没听错的话,你想制作 2 个数字,每个数字都有多个子图?
  • 是的,这就是我需要的@rcompton

标签: matlab simulink subplot


【解决方案1】:

找到答案

figure1 = figure; figure2 = figure;
while i < 4
   kS = kS_array(i);
   bS = bS_array(i);
   sim('sim_1');
   set(0, 'currentfigure', figure1);
   subplot(3,1,i), plot(time,x);
   set(0, 'currentfigure', figure2);
   subplot(3,1,i), plot(time, FT);
   i=i+1;
end

这是我想要的方式。

【讨论】:

  • 非常适合自己寻找答案。实际上,“传统”的做法是figure(1)figure(2),而不是每个set(...
猜你喜欢
  • 2021-12-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-01-08
  • 1970-01-01
  • 2020-02-11
相关资源
最近更新 更多