Generating executable from Simulink model with custom output name

3 ビュー (過去 30 日間)
Richard Zappulla
Richard Zappulla 2016 年 4 月 8 日
コメント済み: Richard Zappulla 2016 年 5 月 29 日
All,
When generating a Linux executable from a Simulink diagram (via a custom function that sets the appropriate parameters for the build) utilizing
rtwbuild()
is it possible to change the name of the output executable?
That is, say I have a model named some_model_01.slx. After building the diagram, the standard output file name is some_model_01. Is there a way to have the resulting executable name be, say, test_model_01? Or perhaps, a way I can push a "-o [output name]" flag to the gcc compiler programmatically?
Thanks!

採用された回答

Debarati Banerjee
Debarati Banerjee 2016 年 4 月 14 日
編集済み: Debarati Banerjee 2016 年 4 月 14 日
This may be achieved by changing the Makefile configuration and adding an argument to the Make command:
make_rtw PRODUCT=../newname.exe
where newname is the custom name you want to set for the executable.
You can use the following command to upate the Make Command in the Configuration Parameter:
>>cset=getActiveConfigSet(gcs)
>>set_param (cset1, 'MakeCommand', 'make_rtw PRODUCT=../newname.exe')
Please check this link to see how Model can be configured using Command Line Interface.
This works for Microsoft Visual C++ 2010. The make command may change in different compilers, but the approach should remain the same.
Hope this helps.
Cheers, Debarati
  1 件のコメント
Richard Zappulla
Richard Zappulla 2016 年 5 月 29 日
Debarati,
Thanks for your help! I just got back to working on this project and was able to implement with ease.
I tweaked your implementation slight by changing "." to ".." before the slash so the executable newname.exe was outside the build folder.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulink Coder についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by