How do I create print statements in C++ generated code from MATLAB Coder?
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 3 Dez. 2019
Bearbeitet: MathWorks Support Team
am 5 Mär. 2020
I currently use the "disp" function to debug my code and review the intermediate steps. Currently, the "disp" functions do not appear in generated code from MATLAB Coder, so I cannot review the intermediate results in the generated code. Are there any workarounds that allow me to print to the system's command line from the C++ generated code?
Akzeptierte Antwort
MathWorks Support Team
am 5 Mär. 2020
Bearbeitet: MathWorks Support Team
am 5 Mär. 2020
There is no direct conversion from disp to printf, but there are tools at your disposal for a workaround.
For example, you can use "fprintf" in MATLAB, which is supported for code generation, and the string/char array you want to print. Check out this link to get started on this:
The above link highlights the necessary ingredients to print information on the command window.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu MATLAB Coder finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!