Can I generate C code from a simulink model with a mask

4 views (last 30 days)
I have a simulink block with a number of inputs and outputs. I've also created a mask which allows the user to define parameters within the block.
If I generate C code from the block, how are the masked parameters, code, icon and constraints in the mask treated?
Thanks.

Accepted Answer

Ayush
Ayush on 28 Sep 2023
Hi Paul,
I understand you want to know how the C code will be generated for your defined mask parameters, code, icon and constraints.
So the generated C code from Simulink for a block consisting of masked parameters is treated as tuneable variables in the generated code. These variables allow you to modify the behaviour of the code, either through an interface or directly changing the generated code. The generated code maps the mask parameters to function block inputs that can be used for customization or configurations purposes. Please refer to the below documentations to know more about the code generation of mask parameters and also the limitations involved in block parameter tunability for code generations respectively:
Additionally, the icon and constraints defined in the mask are not directly translated into the generated code. They are used for visual representation and validation purposes within the Simulink environment. However, the code generated for the block will still incorporate the functionality and behaviour defined by the mask.
It's important to note that the specific details of how the masked parameters, code, icon, and constraints are treated in the generated code can vary depending on the specific settings and configurations of your Simulink model and the code generation options you choose.
Hope it helps,
Regards,
Ayush Misra

More Answers (0)

Categories

Find more on Author Block Masks in Help Center and File Exchange

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!