필터 지우기
필터 지우기

Defining structure names in generated code

조회 수: 6 (최근 30일)
Ross
Ross 2018년 10월 1일
댓글: Ross 2018년 10월 29일
Hello,
I recently updated Matlab from R2013b to R2018a and have been looking at the changes in generated code from Matlab Coder. One thing I have noticed is a slight change in the generated structure name and so I was wondering if this can be controlled? I presumed there might be something in the Model Configuration Parameter settings, but can't see what I am looking for.
Many Thanks.

답변 (1개)

Ji Lee
Ji Lee 2018년 10월 1일
Control of struct names in generated code is achieved using coder.cstructname in MATLAB Coder.
v = struct('a',1,'b',2);
coder.cstructname(v, 'myStruct');
For complete information about coder.cstructname, please have a look here: https://www.mathworks.com/help/coder/ref/coder.cstructname.html
  댓글 수: 3
Darshan Ramakant Bhat
Darshan Ramakant Bhat 2018년 10월 29일
Hi Ross,
Please let us know if you are trying to generate code from MATLAB or Simulink. Your question mentions MATLAB Coder but this comment mentions about the model configuration.
The answer Ji Lee provided is specific to MATLAB to C Code conversion using MATLAB Coder.
Ross
Ross 2018년 10월 29일
Hi Darshan,
Yeah I probably used the wrong tag, I am generating code from a Simulink model.

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

카테고리

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

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by