S-Function using printf in mdlStart

7 次查看(过去 30 天)
Sam
Sam 2012-3-30
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
...

回答(3 个)

Kaustubha Govind
Kaustubha Govind 2012-3-30
You need to use ssPrintf.

Isidro Corral
Isidro Corral 2016-11-2
ssPrintf is not working either

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

产品

Community Treasure Hunt

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

Start Hunting!

Translated by