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

  • 相关阅读:
    快递标示
    git 操作命令系列
    在线js调试地址
    jQuery 的 validator 验证动态添加的信息
    mysql批量插入
    array_map 批量对数据执行某个自定义方法
    使用 header函数实现文件下载
    设置UTF-8 编码
    常用短信接口平台
    async: false 实现AJAX同步请求 ( $.ajax同步/异步(async:false/true) )
  • 原文地址:https://www.cnblogs.com/dingdangsunny/p/12246237.html
Copyright © 2011-2022 走看看