필터 지우기
필터 지우기

mxCreateCellMatrix and mxSetCell are not supported in Simulink Coder

조회 수: 1 (최근 30일)
David Kenko
David Kenko 2016년 8월 31일
My Simulink model with S-Function does not work in External Mode-Simulink. Because the mxCreateCellMatrix and mxSetCell are not supported in simulink coder. How can I solve the problem? this C-program part looks thus:
......................
......................
......................
mxArray *pm, *chrAry;
mwSize m, n;
mwIndex indx; ............... .................
/ 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);

답변 (0개)

카테고리

Help CenterFile Exchange에서 Code Generation and Deployment에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by