model = bdroot returns the top-level
model of the current system. The current system is the currently active Simulink® Editor window or the system in which a block is selected.
model = bdroot(elements)
returns the top-level model of the specified model elements. Before using
bdroot, make sure the top-level model of each element in
elements is loaded.
elements — Model elements whose top-level models to return model name | block path name | handle | cell array of character vectors | string array | numeric array
Model elements whose top-level model to return, specified as the model
name, block or system path name, handle, cell array of character vectors or
string array of system names, or numeric array of handles.
Tip
Use bdroot with gcs,
gcb, and gcbh to get the
top-level model of the current system or block.
model — Top-level model character vector | cell array | string array
Top-level model, returned as a character vector of the model name. If the
input was an array, model is returned as an array of the
same type as the input.