【发布时间】:2016-03-17 11:44:07
【问题描述】:
我有一个脚本,它对 Simulink 编码器生成的初始代码进行一些后处理。它创建了一个我希望添加到构建过程中的additional.c 文件。我想通过脚本将文件添加到构建过程中,所以我关注the docs here。
所以我的脚本看起来像:
slbuild(gcs);
% generate additional.c file using files created by slbuild()
% ...
% now attempt to add additional.c to the build process as custom code
configs = getActiveConfigSet(gcs);
configs.set_param('SimUserSources', 'additional.c');
% now rebuild
slbuild(gcs)
我可以验证配置集是否已通过以下方式更新:
checkConfigIsSet = configs.get_param('SimUserSources');
disp(checkConfigIsSet); % prints: additional.c
但是,编码器似乎没有选择这个新配置。当我单击代码生成报告的Configuration settings at the time of code generation: click to open 部分时,我看到配置值未更新,additional.c 未编译到模型中。
请问我做错了什么?
【问题讨论】:
标签: matlab simulink matlab-coder