フィルターのクリア

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

1 回表示 (過去 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 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by