find_system
List the blocks of a model, optionally filtered by type.
📝Syntax
paths = find_system(sys)
paths = find_system(sys, 'BlockType', type)
📥Input Arguments
Parameter Description
args see the syntaxes above.
📤Output Arguments
Parameter Description
paths a cell array of path strings ('sys' and 'sys/BlockName').
📄Description

find_system lists the blocks of a model, optionally filtered by type.

find_system(sys) returns the model itself and every block under it, as a cell array of paths ('sys' and 'sys/BlockName').

find_system(sys, 'BlockType', type) returns only the paths of blocks whose type is type (the model itself is omitted). An unknown property name is an error.

💡Examples
new_system('demo');
add_block('nflow/source/sine', 'demo/Sine');
add_block('nflow/math/gain', 'demo/Gain', 'gain', 2);
paths = find_system('demo')
gains = find_system('demo', 'BlockType', 'gain')
bdclose('demo');
🔗See Also
new_systemadd_blockget_paramset_param
🕔Version History
Version Description
1.0.0 initial version
Edit this page on GitHub