| Using Simulink | Search  Help Desk |
| find_system | Examples See Also |
Find systems, blocks, lines, and annotations.
Syntax
find_system(sys, 'constraint', cv, `p1', v1, `p2', v2,...)
Description
find_system(sys, constraint, cv, `p1', v1, `p2', v2,...) searches the system(s) or subsystems specified by sys, using the constraint specified by constraint, and returns handles or paths to the objects having the specified parameter values v1, v2, etc. sys can be a pathname (or cell array of pathnames), a handle (or vector of handles), or omitted. If sys is a pathname or cell array of pathnames , find_system returns a cell array of pathnames of the objects it finds. If sys is a handle or a vector of handles, find_system returns a vector of handles to the objects that it finds. If sys is omitted, find_system searches all open systems.
Case is ignored for parameter names. Value strings are case sensitive. Any parameters that correspond to dialog box entries have string values. See Appendix A for a list of model and block parameters.
You can specify any of the following search constraints.constraint' is omitted, find_system uses the default constraint values.
Examples
This command returns a cell array containing the names of all open systems and blocks.find_systemThis command returns the names of all open block diagrams.
open_bd = find_system('Type', 'block_diagram')
This command returns the names of all Goto blocks that are children of the Unlocked subsystem in the clutch system.
find_system('clutch/Unlocked','SearchDepth',1,'BlockType','Goto')
These commands return the names of all Gain blocks in the vdp system having a Gain parameter value of 1.
gb = find_system('vdp', 'BlockType', 'Gain')
find_system(gb, 'Gain', '1')
The above commands are equivalent to this command.
find_system('vdp', 'BlockType', 'Gain', 'Gain', '1')
These commands obtain the handles of all lines and annotations in the vdp system.
sys = get_param(`vdp', `Handle'); l = find_system(sys, `FindAll', 'on', 'type', 'line'); a = find_system(sys, `FindAll', `on', `type', `annotation');
See Also
get_param, set_param