findall

Finds all objects that have a property named propertyName and the value for such property is propertyValue. findall performs the same search as findobj but includes objects for which 'handlevisibility' property is set to 'off' and their children.

Syntax

findall(propertyName, propertyValue, ...)

findall(propertyName, propertyValue, '-operator', propertyName, propertyValue)

findall('-property', propertyName)

findall(handleList, propertyName, propertyValue, ...)

findall(handleList, '-depth', depth, ...)

findall(handleList, 'flat', ...)

Inputs

propertyName
Property name. If the property name is following the keyword '-property' then the search returns all objects that have this property.
Type: string
propertyValue
Value of the property.
Type: double | char | logical | struct | cell | integer
Dimension: scalar | vector | matrix
-operator
A logical operator that is applied on the pair of properties and values. Valid values are: '-and', '-or', '-xor' and '-not'.
Type: string
handleList
Vector of the handles.
Type: double | integer
Dimension: vector
depth
Limits the search to a certain object hierarchy depth. A depth of 0 limits the search to the objects in the given handleList.
Type: integer
Dimension: scalar
'flat'
Keyword 'flat' limits the search to the objects in the given handleList.
Type: integer
Dimension: scalar

Examples

Simple findall example:

figure(1);
lh = plot(rand(10,2));

figure(2);
lh = plot(rand(10,2));
set(gcf, 'handlevisibility','off')

findobj('type', 'figure')
findall('type', 'figure')

findobj('type', 'axes')
findall('type', 'axes')
ans = 1
ans = [Matrix] 1 x 2
2  1
ans = 11.9877187
ans = [Matrix] 1 x 2
17.23644  11.98772