How can I select the working dimension by supplying the DIM argument?
조회 수: 10 (최근 30일)
이전 댓글 표시
While generating C code for below code:
a= [1 2 3 4 5];
u = a/max(a);
I am getting error:
The working dimension was selected automatically, is variable-length, and has length 1 at run time. This is not supported. Manually select the working dimension by supplying the DIM argument.
How can I solve this?
댓글 수: 2
John D'Errico
2019년 11월 7일
Read the help for max. Look at the various ways you can use the max function.
답변 (1개)
Steven Lord
2020년 10월 19일
In the Extended Capabilities section of the documentation page for the max function, expand the "C/C++ Code Generation" item. The page linked in the third bullet in that item, "Variable-Sizing Restrictions for Code Generation of Toolbox Functions", offers some explanation and a suggestion for how to resolve the problem.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Deployment Basics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!