Include a printf in compiled simulink blocks
13 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Kaustubha Govind
el 20 de Abr. de 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 comentarios
Ver también
Categorías
Más información sobre Simulink Coder en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!