Converting cell function into c/c++ code when using MATLAB Coder.

조회 수: 1 (최근 30일)
I'm trying to convert m files into c/c++ code using MATLAB Coder. When I try to perform code generation with MATLAB Coder, some errors about cell function are revealed as following:
'Varagout expected. Code generation supports cell subscripted assignment for varagout only'
How can I prove this problem?
codes are described below:
...
width=cell(14,1);
height=cell(14,1);
width{1}=N;
height{1}=M;
...
Errors were occurred in the {1}.

채택된 답변

Kaustubha Govind
Kaustubha Govind 2011년 12월 8일
Like the error message states, cell arrays are not supported for code-generation in general. If your cell arrays only hold numbers (all of the same datatype), you can convert them all to matrices instead:
...
width=zeros(14,1);
height=zeros(14,1);
width(1)=N;
height(1)=M;
...

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Coder에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by