Simulink仿真入門到精通(六) Simulink模型保存爲圖片

6.1 截圖保存方式

Ctrl+Alt+A函數

6.2 拷貝視圖方式

Edit→Copy Current View to Clipboardspa

6.3 saveas函數

用於保存figure或者simulink框圖。code

saveas(h,'filename.ext')%直接將句柄h所表示的對象保存到filename.ext文件中
saveas(h,'filename','format')%將句柄h所表示的對象以format的格式保存到名爲filename的文件中
後綴名 格式說明 後綴名 格式說明
ai Adobe Illustrator pbm Portable bitmap
bmp Windows位圖 pcx Paintbrush 24位(不支持Simulink模型)
emf Enhanced metafile pdf Portable Document Format
eps EPS Level 1 pgm Protable Graymap
fig MATLAB圖像(不支持Simulink模型) png Portable Network Graphics
jpg JPEG image(不支持Simulink模型) ppm Protable Pixmap
m MATLAB file(不支持Simulink模型) tif 壓縮的TIFF圖像

示例:orm

>> h=get_param(gcs,'handle')

h =

    4.0002

>> saveas(h,'example','png')

多格式保存:對象

formats = {'bmp','emf','eps','pbm','pdf','pgm','png','ppm','tiff'};
name = 'simulink_saveas';
for ii = 1:length(formats)
    saveas(get_param(gcs, 'handle'),name, formats{ii});
end

6.4 print函數

>> print('-s')
>> print('-smymodel')
>> print('-smymodel','-dbmp','1')

-d支持的格式包括'bmp','eps','pbm','pdf','pgm','png','ppm','tiff'。blog

相關文章
相關標籤/搜索