Why char is stored as 2 bytes in S-Function?

Hi all,
I would like to pass an uint8 array to my S-Function as a parameter:
inParam = char(uint8(1:7))
In the S-Function I did the followings
UINT8_T *inParam = (UINT8_T *)mxGetPr(ssGetSFcnParam(S, PARAM_IN_PORT_NR)); //;
but I saw that atually the array elements are stored as 2 bytes.
UINT16_T *inPorts = (UINT16_T *)mxGetPr(ssGetSFcnParam(S, PARAM_IN_PORT_NR)); //
// I can loop through the data
// This is only a snipet
*(inPorts++);
Why is that? Is this happening in all the Matlab versions?

Respuestas (0)

Preguntada:

Run
el 21 de Nov. de 2019

Editada:

Run
el 21 de Nov. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by