How to keep user code remained after rebuiding model/regenerating code?

Hi everyone,
I'm using Simulink to automatically generate code. After code generation, my user code will be added into a source file (for example main.c). But once the Simulink model has been rebuilt, all the user code is deleted, so that I have to write it every time.
I wonder if there is a way to keep user code remained after rebuiding the model/regenerating code?
Thanks a lot!

1 件のコメント

Sam
Sam 2017 年 11 月 21 日
Is there anyone who has a good idea about it?

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

 採用された回答

Birdman
Birdman 2017 年 11 月 21 日

0 投票

Go to Configuration Parameters->Simulation Target and there you will see two sections. Try to include your user code to source file or header file and see the results.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSimulink Coder についてさらに検索

質問済み:

2017 年 11 月 20 日

コメント済み:

2017 年 11 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by