convertToCell
Convert block path to cell array of character vectors
Description
Examples
Create Cell Array that Represents Block Path
Open the project named ModelReferenceHierarchy
.
openProject("ModelReferenceHierarchy");
The project opens a model hierarchy with sldemo_mdlref_depgraph
as the top model.
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 = 3x1 cell
{'sldemo_mdlref_depgraph/thermostat' }
{'sldemo_mdlref_heater/Fahrenheit to Celsius'}
{'sldemo_mdlref_F2C/Gain1' }
Input Arguments
bp
— Fully specified block path
Simulink.BlockPath
object | Simulink.SimulationData.BlockPath
object
Fully specified block path, specified as a Simulink.BlockPath
or
Simulink.SimulationData.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
cellarray
— Block path elements
cell array of character vectors
Block path elements, returned as a cell array of character vectors.
Version History
Introduced in R2010b
MATLAB-Befehl
Sie haben auf einen Link geklickt, der diesem MATLAB-Befehl entspricht:
Führen Sie den Befehl durch Eingabe in das MATLAB-Befehlsfenster aus. Webbrowser unterstützen keine MATLAB-Befehle.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)