Include a printf in compiled simulink blocks
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Dear all, I'm compiling my Simulink model in order to have an executable files. It works flawlessly but I would like to include a printf of some Simulink variables, in order to see their values at run-time. Something like adding
printf("\rx: %f, y: %f, z: %f", x, y, z);
In other words, I would like to see:
$ ./test x: 0.4812, y: 0.2323, z: 0.78321
being x,y,z variables I have in my Simulink model.
Thank you very much for your help.
0 Commenti
Risposte (1)
Kaustubha Govind
il 20 Apr 2012
Which blocks do these signals correspond to? If they are S-function blocks that you have written, you can put the printf commands in the corresponding TLC file. Beyond that, you might need to use advanced Simulink Coder concepts depending on what kind of target you are generating and whether the signals are outputs of specific blocks/subsystems. If you only need to do this for debugging, I would recommend just putting in the printf commands manually into the generating code.
Note: What you're asking for is not supported on a generic embedded system and therefore is not part of the core Simulink/Embedded Coder features. Note that an stdout is not even present on a lot of embedded systems.
0 Commenti
Vedere anche
Categorie
Scopri di più su Simulink Coder in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!