Matlab Coder coder.resize and coder.typeof unsupported for code generation

조회 수: 5 (최근 30일)
Hello,
I was wondering why these functions as well as a couple are unsupported seeing as they are part of the Matlab coder toolbox itself, here is the error message I am getting;
----
The function 'typeof' is not supported for standalone code generation. See the documentation for coder.extrinsic to learn how you can use this function in simulation.
Function 'foo.m' (#404.3235.3258), line 45, column 48:
"coder.typeof(char(zeros(1, 7)))"
Launch diagnostic report.
----
Is this something I am doing wrong or is this a bug the coder itself
Regards
Daniel
  댓글 수: 5
Daniel  Clarke
Daniel Clarke 2013년 4월 30일
so we have
TtrajectoryOutput.VendOfWellCoords = [0 0 0]';
VendOfWellCoords = zeros(3,1);
coder.ceval('DRILL_ONE_STEP', ... coder.ref(VendOfWellCoords)); %#ok<ASGLU>
TtrajectoryOutput.VendOfWellCoords = VendOfWellCoords;
where we know at the start that VendOfWellCoords is a 3x1 matrix, and that its struct field counter part are the same size, but when the value is picked after our call the dll function I get the error
Dimension 1 of field 'VendOfWellCoords' is fixed on the left-hand side but varies on the right ([3 x 1] ~= [:? x 1]).
Arnab De
Arnab De 2013년 5월 1일
I do not see any problem with the code you pasted here. Most probably, some other part of the code is causing the problem. Can you open the report and check where exactly the size mismatch is happening?

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

답변 (1개)

Fred Smith
Fred Smith 2013년 5월 3일
coder.resize and coder.typeof are used to construct and manipulate types that are passed as inputs to the codegen command. They cannot be used from the MATLAB Code that you are generating code from.
-Fred

카테고리

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