Save generated code in a special folder in quot;rtwbuildquot;(将生成的代码保存在“rtwbuild的特殊文件夹中)
问题描述
我正在使用 rtwbuild
从模拟图中生成 C++ 代码,并希望将生成的代码保存到任意目录.有什么办法吗?
I am using rtwbuild
to generated C++ code from a Simulation diagrams and would like to save generated code to an arbitrary directory. Is there any way to do so?
推荐答案
您可以通过 3 种不同的方式控制生成文件的文件夹.您可以在 Simulink Preferences 中设置代码生成文件夹"选项.您可以使用 File 菜单从任何模型访问 Simulink 首选项,然后选择 Simulink Preferences.这将更改所有模型的代码生成位置,并将在 MATLAB 会话中持续存在.
You can control the folder for generated files in 3 different ways. You can set the "Code generation folder" option in Simulink Preferences. You can reach to Simulink preferences from any model using File menu and then choosing Simulink Preferences. This will change the code generation location for all models and will persist across MATLAB sesstions.
其次,您可以在 MATLAB 中设置一个全局参数,该参数将再次控制所有模型的代码生成目录,但只会在该 MATLAB 会话中持续存在.例如,
Second you can set a global param in MATLAB which will again control code generation directory for all models but will persist only for that MATLAB session. For example,
set_param(0, 'CodegenFolder', fullfile('C:','Work','mymodelrtw'))
get_param(0, 'CodegenFolder')
您还可以使用 Simulink.fileGenControl 对象来设置 codegen 文件夹,如上面的会话参数.此对象对保留以前的文件夹路径和选择性地创建文件夹有更多的控制权.
You can also use Simulink.fileGenControl object to set the codegen folder like the session param above. This object has more control about retaining previous folder paths and creating the folder optionally.
在 查看这些文档http://www.mathworks.com/help/rtw/ug/control-the-location-for-generated-files.html
这篇关于将生成的代码保存在“rtwbuild"的特殊文件夹中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:将生成的代码保存在“rtwbuild"的特殊文件夹中


基础教程推荐
- 如何在 C++ 中初始化静态常量成员? 2022-01-01
- 如何检查GTK+3.0中的小部件类型? 2022-11-30
- 如何将 std::pair 的排序 std::list 转换为 std::map 2022-01-01
- 常量变量在标题中不起作用 2021-01-01
- 在 C++ 中计算滚动/移动平均值 2021-01-01
- C++结构和函数声明。为什么它不能编译? 2022-11-07
- 这个宏可以转换成函数吗? 2022-01-01
- 如何通过C程序打开命令提示符Cmd 2022-12-09
- 我有静态或动态 boost 库吗? 2021-01-01
- 静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么? 2021-01-01