【问题标题】:How to automate Matlab/Simulink/Real-TimeWorkshop code generation?如何自动化 Matlab/Simulink/Real-TimeWorkshop 代码生成?
【发布时间】:2010-09-25 14:58:18
【问题描述】:

我想使用 Simulink mdl 以自动方式生成 C 文件。我目前正在尝试使用 m-script 和 dos 命令 shell,但我遇到了挂起 m-script 的“你想保存”对话框的问题。通过实验,我知道在运行“set_param”行时正在修改 mdl(即,如果删除了 set_param 调用,则不会出现“保存”对话框问题),但我需要在生成代码之前对 mdl 进行一些设置。

m-脚本:

rtwdemo_counter
set_param(gcs,'SystemTargetFile','ert.tlc')
rtwbuild(gcs)
exit

做事

matlab -r samplebuild -nosplash -nodesktop

Windows XP 上的 Matlab 7.7.0,471

我的最终目标是在持续集成服务器 (CruiseControl) 上自动生成代码,我觉得必须有一种更强大的方式来使用 matlab 工具链来实现这一目标。

【问题讨论】:

    标签: matlab build-process continuous-integration build-automation


    【解决方案1】:

    使用以下命令强制关闭模型而不保存:

     close_system(gcs, false);
    

    例如

     rtwdemo_counter
     set_param(gcs,'SystemTargetFile','ert.tlc')
     rtwbuild(gcs)
     close_system(gcs, false);
     exit
    

    【讨论】:

      【解决方案2】:

      你能做这样的事情吗:

      matlab -r samplebuild -nosplash -nodesktop

      ?

      其实我知道你可以做到,只是不确定它会起作用......;)

      【讨论】:

        猜你喜欢
        • 2017-07-06
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-08-09
        • 1970-01-01
        • 2021-05-13
        • 1970-01-01
        相关资源
        最近更新 更多