How to make non inlined s-functions inlined for code generation

7 ビュー (過去 30 日間)
Aubrey
Aubrey 2024 年 8 月 5 日
回答済み: Raghava S N 2024 年 8 月 7 日
I'm in simulink with a subsystem, I right click, c c++ code gen, create s-function. When I control b to build code, I get an error about non-inlined sfunction. I see I need the sfunction.tlc header file to create an inlined sfunction. How do I create this for each s-function I need to build for?
sfcn' is a non-inlined S-function, which is not supported with the current configuration. Consider selecting Support non-inlined S-functions.

回答 (1 件)

Raghava S N
Raghava S N 2024 年 8 月 7 日
Hi Aubrey,
Writing S-functions to be included in generated code involves requirements that go beyond writing S-functions used only for simulation. Before proceeding to inline an S-function, make sure that it meets the requirements for code generation and functions as expected. For more information, refer to the documentation of “S-Functions and Code Generation” by using the “web” command in the MATLAB command window -
web(fullfile(docroot, '/rtw/ug/s-functions-and-code-generation.html'))
Once the requirements are met, you can inline the functionality of MATLAB file S-functions in the generated code. For the step-by-step guide on how to inline MATLAB File S-Functions in Simulink, refer to the documentation of “Inline S-Functions” by using the “web” command in the MATLAB command window -
web(fullfile(docroot, '/rtw/tlc/introduction-inline-s-functions.html'))
Hope this helps!
Raghava

カテゴリ

Help Center および File ExchangeFunction Creation についてさらに検索

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by