Main Content

isProtected

Determine component reference model is protected

Since R2021b

Description

flag = isProtected(compObj) determines whether or not the referenced model on the component is protected. A protected model is saved with an SLXP extension.

example

Examples

collapse all

Find whether or not the referenced model on the component is protected.

Create a new System Composer™ model and add a new component.

model = systemcomposer.createModel("archModel");
rootArch = get(model,"Architecture");
newComponent = addComponent(rootArch,"newComponent");

Create new Simulink® reference model and save.

newRef = new_system("newReference","Model");
save_system(newRef);

Protect the Simulink model reference.

Simulink.ModelReference.protect(newRef);

Link the Simulink model to the component newComponent.

linkToModel(newComponent,"newReference.slxp");

Verify that the reference model linked to the component is protected.

flag = isProtected(newComponent)
flag =

  logical

   1

Input Arguments

collapse all

Output Arguments

collapse all

Whether referenced model on component is protected, returned as 1 (true) or 0 (false).

Data Types: logical

More About

collapse all

Version History

Introduced in R2021b