Custom M-file

Automatically update active configuration parameters of parent model using custom M-file

Library

Configuration Wizards

Description

When you add a Custom M-file block to your Simulink® model and double-click it, a custom M-file script executes and automatically configures model parameters that are relevant to code generation. You can also set a block option to invoke the build process after configuring the model.

After double-clicking the block, you can verify that the model parameter values have changed by opening the Configuration Parameters dialog box and examining the settings.

The MathWorks™ provides an example M-file script, matlabroot/toolbox/rtw/rtw/rtwsampleconfig.m, that you can use with the Custom M-file block and adapt to your model requirements. The block and the script provide a starting point for customization. For more information, see Creating a Custom Configuration Wizard Block in the Real-Time Workshop® Embedded Coder™ documentation.

Parameters

Configure the model for

Value selected from

For this block, Custom is selected by default.

Configuration function

Name of the predefined or custom M-file script to be used to update the active configuration parameters of the parent Simulink model. The default value is rtwsampleconfig, which refers to the example M-file script rtwsampleconfig.m.

Invoke build process after configuration

If selected, the script initiates the code generation and build process after updating the model's configuration parameters. If not selected (the default), the build process is not initiated.

See Also

ERT (optimized for fixed-point), ERT (optimized for floating-point), GRT (debug for fixed/floating-point), GRT (optimized for fixed/floating-point)

Optimizing Your Model with Configuration Wizard Blocks and Scripts in the Real-Time Workshop Embedded Coder documentation

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS