Hello everybody,
Halle All, Please I have a question. How can I write this function without mxCreateCellMatrix and mxSetCell? Because the Simulink Coder can not support this. Thank you in advance. Greeting David
// put the names of the output channels in a cell-array variable called “OutList” in the base matlab workspace
m = NumOutputs;
n = 1;
pm = mxCreateCellMatrix(m, n);
for (i = 0; i < NumOutputs; i++){
j = CHANNEL_LENGTH - 1;
while (ChannelNames[i*CHANNEL_LENGTH + j] == ’ '){
j–;
}
strncpy(&OutList[0], &ChannelNames[i*CHANNEL_LENGTH], j+1);
OutList[j + 1] = ‘\0’;
chrAry = mxCreateString(OutList);
indx = i;
mxSetCell(pm, indx, chrAry);
//mxDestroyArray(chrAry);
}
ErrStat = mexPutVariable("base", "OutList", pm);
mxDestroyArray(pm);