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

38 次查看(过去 30 天)
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,5:28
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 CenterFile Exchange 中查找有关 Function Creation 的更多信息

产品


版本

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by