필터 지우기
필터 지우기

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

조회 수: 14 (최근 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 CenterFile Exchange에서 Simulink Coder에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by