MATLAB Coder: Option "generate one file for each MATLAB file"

조회 수: 3 (최근 30일)
Andreas Schröffer
Andreas Schröffer 2017년 8월 21일
댓글: Andreas Schröffer 2017년 8월 30일
Hello, I want to produce C/C++ standalone Code with MATLAB Coder. Although i took the option "generate one file for each MATLAB file" some MATLAB files are translated together in one C/C++ file. Is there another option to take influence on that? Kind regards Andreas
  댓글 수: 6
Carl
Carl 2017년 8월 28일
Thanks for following up. To prevent MATLAB Coder from inlining a function, you can use the line "coder.inline('never')". For example:
function b = fcn2(a)
coder.inline('never')
b = a + 1;
end
This will prevent fcn2 from being inlined in fcn1.
Andreas Schröffer
Andreas Schröffer 2017년 8월 30일
Thank you.
The option coder.inline('never') was exactly, what i was searching for.

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

채택된 답변

Carl
Carl 2017년 8월 28일
Possible solutions:
  1. Provide both functions as an entry-point function
  2. Use the coder.inline flag to control whether a function gets inlined (see documentation below)
https://www.mathworks.com/help/simulink/slref/coder.inline.html

추가 답변 (0개)

카테고리

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