Main Content

Simulink.BlockDiagram.deleteContents

R2026b

Delete graphical contents of model

Description

Simulink.BlockDiagram.deleteContents(sys) deletes the blocks, signal lines, and annotations in the specified model. The specified model must be loaded.

example

Examples

collapse all

Suppose you have a loaded model named myModel.

Delete the blocks, signal lines, and annotations in the model.

Simulink.BlockDiagram.deleteContents("myModel:)

Input Arguments

collapse all

Model containing the content that you want to delete, specified as a handle or name. Format the handle as a numeric scalar. Format the name as a string or character vector. Do not include an extension with the model name.

For information about getting handles, see Get Handles and Paths.

Example: "myModel"

Data Types: double | string | character vector

Tips

To delete the contents of a Subsystem block, use the Simulink.SubSystem.deleteContents function.

Version History

Introduced in R2007a