필터 지우기
필터 지우기

How can I select the working dimension by supplying the DIM argument?

조회 수: 10 (최근 30일)
Shubhashree Bal
Shubhashree Bal 2019년 11월 7일
답변: Steven Lord 2020년 10월 19일
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
John D'Errico 2019년 11월 7일
Read the help for max. Look at the various ways you can use the max function.
Rutvik Shete
Rutvik Shete 2020년 10월 19일
Use elementwise division. u = a./max(a); "dot" is important.

댓글을 달려면 로그인하십시오.

답변 (1개)

Steven Lord
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.

카테고리

Help CenterFile Exchange에서 Deployment Basics에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by