How to prevent MATLAB Coder from breaking up input structures

조회 수: 10 (최근 30일)
Paul Silversmith
Paul Silversmith 2020년 6월 15일
편집: Anmol Dhiman 2020년 6월 30일
MATLAB Coder will sometimes treat a subset of the fields of an input structure as individual inputs. How can I direct MATLAB Coder to always pass the entire structure?
e.g.
struct.A = 1; struct.B = 2; struct. C = 3
[output] = myfunction(struct)
MATLAB Coder will sometimes generate code as follows:
[output] = myfunction(struct_A,struct_B)

채택된 답변

Anmol Dhiman
Anmol Dhiman 2020년 6월 23일
편집: Anmol Dhiman 2020년 6월 30일
Hi Paul,
This is an optimization that occurs by default when generating code and may be disabled in certain circumstances. To determine whether this will work for you, please reach out to MathWorks technical support.
Regards,
Anmol Dhiman

추가 답변 (0개)

카테고리

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

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by