set(gcf,'windowstyle','normal');
用工具栏调整图形后,如果想通过代码来设置图片和figure的大小,必须先单独运行一下次命令,后边的“set(gcf,'unit','centimeters','position',[a b c d]);”和set (gca,'position',[a,b,c,d]);才会生效,否则会弹出“警告: 不能在 WindowStyle 为 'docked' 时设置 Position 。”
plot(变量名.time,变量名.signals.values,'颜色代码');hold on;
先在simulink的scope中将波形结果log data to workspace,save format选择structure with time,variable name表示变量名,自己随意设置。然后使用plot画图指令。
box off;
去掉右边与上面的边框,使用效果对比:
![ade412afeff4340129d835d765252182.png](https://img-blog.csdnimg.cn/img_convert/ade412afeff4340129d835d765252182.png)