Why does my executable generated with Simulink Embedded Coder crash when using non-integer inputs to the program?
2 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2019-8-22
回答: MathWorks Support Team
2019-8-28
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?
采纳的回答
MathWorks Support Team
2019-8-29
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 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!