h = findobj()
h = findobj(prop, value)
h = findobj(objhandles, prop, value)
h = findobj(objhandles, 'flat', ...)
h = findobj(objhandles, '-depth', d, ...)
h = findobj(..., '-property', prop)
h = findobj(..., '-regexp', prop, expr)
| Parameter | Description |
|---|---|
| objhandles | graphics object or array of graphics objects to search from. |
| prop | property name as a character vector or scalar string. |
| value | property value to match. |
| d | nonnegative integer search depth, or Inf. |
| expr | regular expression used to match a character property value. |
| Parameter | Description |
|---|---|
| h | column array of matching graphics objects. |
findobj searches the graphics object hierarchy from the root object or from the supplied graphics objects. Objects whose HandleVisibility property is 'off' , and their descendants, are not returned.
Property predicates can be combined with '-and' , '-or' , '-xor' , and '-not' . Use cell arrays to group expressions.
close all
plot(rand(5))
h = findobj('Type', 'line')
close all
plot(1:10, 'Tag', 'linear')
h = findobj('-regexp', 'Tag', 'lin')
close all
plot(1:10, 'Tag', 'linear')
hold on
plot((1:10).^2, 'Tag', 'quadratic')
h = findobj('Type', 'line', '-and', '-not', {'Tag', 'linear'})
| Version | Description |
|---|---|
| 1.17.0 | initial version |