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

2 vues (au cours des 30 derniers jours)
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?

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 29 Août 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:

Plus de réponses (0)

Catégories

En savoir plus sur Simulink Coder dans Help Center et File Exchange

Produits


Version

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by