Why does my executable generated with Simulink Embedded Coder crash when using non-integer inputs to the program?

Why does my executable generated with Simulink Embedded Coder crash when using non-integer inputs to the program? I have modified the main file to accept a number as input, to specify the simulation end time. If I start the executable with an integer input, it runs fine. If I start the executable with a decimal input, it crashes without warning or error. Why is this and how can I solve it?

 채택된 답변

In this particular case, Simulink Coder or Simulink Embedded Coder do not generate code for main functions that allow programs to take input values. Therefore this executable was built with a modified main.c file, where code for inputs must have been added to the main function (args c, args v[], and subsequent logic). for this functionality to be present.
Possible solution
The most likely issue is that the main function is not converting the char input to double correctly. Check out this external link for clues on how to fix it:

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Simulink Coder에 대해 자세히 알아보기

제품

릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by