Why does my executable generated with Simulink Embedded Coder crash when using non-integer inputs to the program?
2 views (last 30 days)
Show older comments
MathWorks Support Team
on 22 Aug 2019
Answered: MathWorks Support Team
on 28 Aug 2019
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?
Accepted Answer
MathWorks Support Team
on 29 Aug 2019
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 Comments
More Answers (0)
See Also
Categories
Find more on Simulink Coder in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!