Main Content


Configure protected model to use specified target



Simulink.ProtectedModel.setCurrentTarget(protectedModel, targetID) configures the protected model to use the target that the target identifier specifies.


If you include the protected model in a model reference hierarchy, the software tries to change the current target to match the target of the parent model. If the software cannot match the target of the parent, it reports an error.


collapse all

After you get a list of supported targets, set the current target for a protected model.

Load the model and save a local copy.


Add a required password for modifying a protected model. If you do not add a password, you are prompted to set a password when you create a modifiable, protected model.


Create a modifiable, protected model with support for code generation.

'CodeGeneration', 'Modifiable',true, 'Report',true);

Get a list of targets that the protected model supports.

 st = Simulink.ProtectedModel.getSupportedTargets('mdlref_counter')

Configure the unprotected model to support a new target.

 set_param('mdlref_counter', 'SystemTargetFile', 'ert.tlc'); 

Add support to the protected model for the new target. You are prompted for the modification password.


Verify that support for the new target has been added to the protected model.

 st = Simulink.ProtectedModel.getSupportedTargets('mdlref_counter')

Configure the protected model to use the new target.


Verify that the current target is the new target.

 ct = Simulink.ProtectedModel.getCurrentTarget('mdlref_counter')

Input Arguments

collapse all

Protected model name, specified as a string or character vector.

Identifier for selected target, specified as a string or character vector.

Version History

Introduced in R2015a