Custom MATLAB file
R2026bUpdate active configuration parameters of parent model by using file containing custom MATLAB code
Libraries:
Embedded Coder /
Configuration Wizards
Description
When you add a Custom MATLAB file block to your Simulink® model and double-click it, a custom MATLAB® script executes and configures model parameters that are relevant to code generation. Set a block parameter to invoke the build process after configuring the model.
After you double-click the block, open the Configuration Parameters dialog box to see that the model parameter values have changed.
Use the example MATLAB script,
with the Custom MATLAB file
block. Adapt the script to your model requirements. The block and the script provide a
starting point for customization. For more information, see Create a Custom Configuration Wizard Block.matlabroot/toolbox/coder/simulinkcoder_core/rtwsampleconfig.m
Note
To provide a quick way to switch between configurations, you can include more than one Configuration Wizard block in your model.
Parameters
Programmatic Use: Add Block
To add the block programmatically, use the add_block function with one of these library block paths as the source.
"rtweclib/Configuration Wizards/Custom MATLAB file"
Example: add_block("rtweclib/Configuration Wizards/Custom MATLAB file","myModel/myBlock",MakeNameUnique="on")
Version History
Introduced in R2011a