S-Function using printf in mdlStart

9 visualizaciones (últimos 30 días)
Sam
Sam el 30 de Mzo. de 2012
Respondida: Mohammad Kia el 17 de Jun. de 2017
I would like to debug my S-Function C code using "printf", but why the mdlStart is not able to print anything out?
static void mdlInitializeSizes {
printf("mdlInitSizn");
}
static void mdlInitializeSampleTimes {
printf("mdlInitTime\n");
}
static void mdlStart(SimStruct *S) {
printf("mdlStart\n");
}
static void mdlOutputs {
print("mdlOutputs\n");
}
OUTPUT:
mdlInitSiz
mdlInitTime
mdlOutputs
mdlOutputs
...

Respuestas (3)

Kaustubha Govind
Kaustubha Govind el 30 de Mzo. de 2012
You need to use ssPrintf.

Isidro Corral
Isidro Corral el 2 de Nov. de 2016
ssPrintf is not working either

Mohammad Kia
Mohammad Kia el 17 de Jun. de 2017
do not include stdio.h in your code, it will re-target the standard io functions. it will work

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by