Can't find main.c file when using SIMULINK code generation

11 ビュー (過去 30 日間)
Rahul
Rahul 2023 年 4 月 10 日
回答済み: Vinayak Choyyan 2023 年 4 月 13 日
If i try to generate code for my model using Simulink code gen. The only files that come are model.c files and other files. However, I am always missing the ,"main.c" file. How do I get that file?

回答 (1 件)

Vinayak Choyyan
Vinayak Choyyan 2023 年 4 月 13 日
Hi Rahul,
As per my understanding, you are trying to generate C code using Simulink Coder and wish to know why the main file is missing.
Simulink Coder generates code for real-time and nonreal-time applications, including simulation acceleration, rapid prototyping, and hardware-in-the-loop testing. In these types of systems, the main function is typically provided by the target operating system or runtime environment, and the generated code is integrated with the system through other means. On the other hand, Embedded Coder is specifically designed to generate code for microcontrollers and other embedded systems that may not have an operating system or runtime environment. Therefore, when generating code using Embedded Coder, there is an option to "Generate a default main function".
Depending on your use case, consider using Embedded Coder to get the main file.
I hope this resolves the issue you are facing.

カテゴリ

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

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by