zoukankan      html  css  js  c++  java
  • Simulink仿真入门到精通(六) Simulink模型保存为图片

    6.1 截图保存方式

    Ctrl+Alt+A

    6.2 拷贝视图方式

    Edit→Copy Current View to Clipboard

    6.3 saveas函数

    用于保存figure或者simulink框图。

    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图像

    示例:

    >> 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'。

  • 相关阅读:
    3.25Java常量
    3.26Java逻辑运算符
    3.26Java关系运算符
    Java标识符
    3.27Java位运算符
    3.26Java运算符(operator)
    3.26Java字符型(char)变量、常量
    3.26Java布尔类型(boolean)变量、常量
    《算法导论》第9章 顺序统计学 (1)最小值和最大值
    《算法导论》第8章 线性时间排序 (1)计数排序
  • 原文地址:https://www.cnblogs.com/dingdangsunny/p/12246237.html
Copyright © 2011-2022 走看看