How to define the data type of the input port data by ''ssGetOutputPortRealSignal'' ?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
In the S-function, the default data type of the output port is SS_DOUBLE. I want to define the data type to SS_SINGLE.I write the lines as follows,but the displaying of the output data is error!I want to know why the result is wrong and I should how to define the data type. Thank you!
static void mdlOutputs(SimStruct *S, int_T tid) { real32_T *y1 = ssGetOutputPortRealSignal(S,0); real_T *y2 = ssGetOutputPortRealSignal(S,1);
int_T in1 = ssGetInputPortWidth(S,0); int_T in2 = ssGetInputPortWidth(S,1); int_T in3 = ssGetInputPortWidth(S,2);
InputPtrsType x = ssGetInputPortRealSignalPtrs(S,2);
real32_T *value_y = x[0]; y1[0] = value_y[0] ; y1[1] = in2; y1[2] = in3;
y2[0] = in1; y2[1] = in2;
}
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Block and Blockset Authoring dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!