Simulink.ID.getSID

Get Simulink Identifier of block, annotation, or Stateflow object

Description

example

simulinkID = Simulink.ID.getSID(obj) returns the Simulink Identifier (SID) of the block, annotation, or Stateflow object obj.

A Simulink Identifier (SID) is a unique and unmodifiable identifier. Use the SID to identify an object throughout its lifetime, even if the name of the object changes.

Examples

collapse all

Open the model vdp.

vdp

Get the SID of the Mu block.

simulinkID = Simulink.ID.getSID('vdp/Mu')

Open the model vdp.

vdp

Select the annotation at the top of the diagram. To get the annotation object, use the function getCurrentAnnotation.

ann = getCurrentAnnotation

Get the SID of the annotation.

simulinkID = Simulink.ID.getSID(ann)

Open the model vdp.

vdp

Get the handle of the Product block.

hdl = getSimulinkBlockHandle('vdp/Product')

Get the SID of the Product block using the handle as the input argument.

simulinkID = Simulink.ID.getSID(hdl)

Input Arguments

collapse all

Name or handle of a block, annotation, or Stateflow object, specified as a handle, character vector, or string scalar.

Example: 'vdp/Mu'

Output Arguments

collapse all

Simulink Identifier (SID), returned as a string scalar.

Introduced in R2009b