Main Content

Simulink.ProtectedModel.getSupportedTargets

Get list of targets that protected model supports

Description

supportedTargets = Simulink.ProtectedModel.getSupportedTargets(protectedModel) returns a list of target identifiers for the code generation targets supported by the specified protected model. The target identifier sim represents simulation support.

example

Examples

collapse all

Add a target to a protected model, and then get a list of supported targets to verify the addition of the new target.

Load the model and save a local copy.

openExample('sldemo_mdlref_counter');
save_system('sldemo_mdlref_counter','mdlref_counter.slx');

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.

Simulink.ModelReference.ProtectedModel.setPasswordForModify(...
'mdlref_counter','password');

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

Simulink.ModelReference.protect('mdlref_counter','Mode',...
'CodeGeneration', 'Modifiable',true, 'Report',true);

Configure the unprotected model to support a new target.

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

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

 Simulink.ProtectedModel.addTarget('mdlref_counter');

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

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

Input Arguments

collapse all

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

Output Arguments

collapse all

List of target identifiers for the targets that the protected model supports, specified as a cell array of character vectors.

Version History

Introduced in R2015a