snapnow
拍摄图像快照以包括在发布文档中
语法
说明
snapnow
拍摄最近生成的图像或绘图的快照,以包括在发布文件中。快照显示在包含 snapnow
命令的代码节的末尾。有关发布的详细信息,请参阅 发布和共享 MATLAB 代码。
在不发布文件的情形中,MATLAB® 将 snapnow
命令解释为 drawnow
命令。
示例
捕获循环中图窗的快照
在循环中的每次迭代后,使用 snapnow
捕获图像的快照。
使用以下代码创建文件 loopIterations.m
,该代码运行 for
循环三次,并在每次迭代后生成图形。
%% Scale magic Data and Display as Image for i=1:3 imagesc(magic(i)) end
保存并发布该文件。MATLAB 显示的发布文件仅包含最终图像的快照。
publish('loopIterations.m') web('html/loopIterations.html')
在 for
循环内添加对 snapnow
函数的调用。
%% Scale magic Data and Display as Image for i=1:3 imagesc(magic(i)) snapnow; end
保存并发布该文件。MATLAB 显示的发布文件包含每个循环迭代的快照。
publish('loopIterations.m') web('html/loopIterations.html')
版本历史记录
在 R2008b 中推出
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)