Main Content

convertToCell

Convert block path to cell array of character vectors

Description

example

cellarray = convertToCell(bp) converts a block path to a cell array of character vectors.

Examples

collapse all

Open the example model, which references multiple models.

sldemo_mdlref_depgraph

Create a Simulink.BlockPath object.

bp = Simulink.BlockPath({'sldemo_mdlref_depgraph/thermostat', ...
'sldemo_mdlref_heater/Fahrenheit to Celsius', ...
'sldemo_mdlref_F2C/Gain1'});

Create a cell array that represents the elements of the block path.

cellarray = convertToCell(bp)
cellarray =

  3×1 cell array

    {'sldemo_mdlref_depgraph/thermostat'         }
    {'sldemo_mdlref_heater/Fahrenheit to Celsius'}
    {'sldemo_mdlref_F2C/Gain1'                   }

Input Arguments

collapse all

Fully specified block path, specified as a Simulink.BlockPath object. This block path uniquely identifies a block within a model hierarchy, even when the model hierarchy references the same model multiple times.

Output Arguments

collapse all

Block path elements, returned as a cell array of character vectors.

See Also

Objects

Functions

Introduced in R2010b