How to customize the code interface of a function generated of a reference model

I was working on a code-generation project with a top model and several referenced models. I found it very easy to customize the name and argument of any entry-point functions in top model after following the link:
However, I could not find where to customize the function interfaces for referenced models. One of the referenced model I have takes a single input and return a single output, and the generated code has the function like:
void foo(const real_T *input, real_T *output);
I want it to be configured as:
real_T foo(const real_T input);
Could anyone give me some guidance?
Much appreciated!

 採用された回答

Mark
Mark 2019 年 7 月 9 日

0 投票

Dear Boru,
If you have Embedded Coder, it is possible to control the entry points using the Function Prototype Control feature (https://www.mathworks.com/help/ecoder/ug/function-prototype-control.html). Basically, you can specify a new name for the "step" function, and each of the root-level ports become function arguments or return values. You can also specify smaller details about these arguments, such as adding "const" or making them pass-by-value or pass-by-reference.
Regards,
Mark Biesiada

その他の回答 (1 件)

Chidvi Modala
Chidvi Modala 2019 年 7 月 30 日

0 投票

TLC (Target Language Compiler) files are used to customize the code building process. They generally come in two varieties
  1. System/model tlc files that help in the overall model conversion process
  2. Block level tlc files which describe how individual blocks (typically S-Functions) get converted to C code.

カテゴリ

ヘルプ センター および File ExchangeDeployment, Integration, and Supported Hardware についてさらに検索

製品

リリース

R2018b

質問済み:

2019 年 7 月 4 日

コメント済み:

2019 年 8 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by