This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Package: sdo

Enable or disable all check blocks in model


chk_blk_state = sdo.setCheckBlockEnabled(modelname,state)


chk_blk_state = sdo.setCheckBlockEnabled(modelname,state) sets the Enabled parameter of all the check blocks in an open Simulink® model to the specified value. The function returns the original value of the Enabled parameter of all the model check blocks.

Use this function to disable the check blocks (model verification blocks) in a model before running an optimization for the model. After optimization completes, you can restore the enabled state of the model check blocks by calling this function again. Use the output from the previous call as the second input for the function.

Input Arguments


Simulink model name, specified as a character vector or string. For example, 'pidtune_demo'.

The model must be open.


Switch enabling or disabling model check blocks, specified as either 'on' or 'off'.

To restore the enabled state of the model check blocks, specify state as the output from the previous call to sdo.setCheckBlockEnabled.

Output Arguments


Original values of the Enabled block parameter of the model check blocks, returned as a cell array of character vectors.


collapse all

Open the model.

modelname = 'pidtune_demo';

Disable the model check blocks in a model.

state = 'off';
chkBlkState = sdo.setCheckBlockEnabled(modelname,state);

Restore the enabled state of the model check blocks.



You can open each model verification block in a model and select or clear the Enable assertion check box.

Introduced in R2012b

Was this topic helpful?