2
A
回答
1
我不知道这样做的单个命令,但您可以使用一小段额外的代码来完成。
% Declare a variable for skipping at the top of your .m file
skip = 1; %example, 1 = skip, 0 = plot
% do things....
% Then nest your plot commands
if (skip == 0) % wants to plot in this case
% Whatever plot code in here
plot(x,y);
end
这应该做的伎俩,虽然我意识到它不是一个干净,单一的功能,如你所要求的。我希望它有帮助! :)
此外,我明白,如果您不一定使用自己的.m文件,或脚本很长,这可能不实际。
0
你也可以在地块后面写close all
,他们会被绘制出来,但会在瞬间关闭之后。它不干净,但工程。
1
你可以用你自己的(嵌套的函数内或在同一目录)重载内建绘图功能:当你打电话myfun
,除非你改变当然plotting=false
function myfun(a,b)
plotting = false;
plot(a,b);
plot(b,a);
function varargout = plot(varargin)
if plotting
[varargout{1:nargout}] = builtin('plot',varargin{:});
end
end
end
不会发生任何事情。
超载内置函数额外的信息:http://www.mathworks.nl/support/solutions/en/data/1-18T0R/index.html?product=ML&solution=1-18T0R
1
您可以所有 MATLAB地块隐形搭配:
set(0, 'DefaultFigureVisible', 'off');
更改off
到on
相反的过程(这你可能需要要做,因为这会关掉全部你的地块!)
你可以将该行添加到您的m文件的开头,然后将
close all;
set(0, 'DefaultFigureVisible', 'on');
加到最后。
相关问题
- 1. 避免CopyFilesToOutputDirectory构建步骤
- 2. python protobufs - 避免安装步骤?
- 3. Pentaho报表输出步骤
- 4. 输出宏执行步骤
- 5. 核心绘图图形标签步骤
- 6. 避免capybaras webkit console.log输出
- 7. 避免循环输出
- 8. 避免输出回路
- 9. 黄瓜:如何避免模棱两可的步骤?
- 10. git stash pop:避免隐藏丢弃和取消暂存步骤
- 11. 如何避免Cucumber中含糊不清的步骤定义?
- 12. 如何避免大型多步骤单元测试?
- 13. 如何避免与text_layer重叠绘图?
- 14. 创建.csv输出的步骤
- 15. R栅格在绘图时避免出现空白
- 16. 避免异步:false;功能
- 17. 如何避免同步
- 18. 避免溢出
- 19. 避免溢出
- 20. 避免冗余异步calcluations
- 21. WinAPI - 避免重绘窗口
- 22. ggplot2避免被绘制点
- 23. 如果我是唯一的用户,请避免ROAuth握手中的PIN步骤?
- 24. 避免打印相同的输出
- 25. 在doxygen输出中避免换行
- 26. str_replace(&)输出#038,如何避免?
- 27. 如何避免输出foreach错误?
- 28. 避免输出缓冲错误serevr
- 29. 避免python输出中的换行
- 30. 如何避免输出参数?
不是我所知道的。但是你总是可以在'-nodisplay'模式下运行,而不用把GUI全部放在一起。 – angainor