Getting Started |
Finding the Handles of Existing Objects
The findobj
command enables you to obtain the handles of graphics objects by searching for objects with particular property values. With findobj
you can specify the value of any combination of properties, which makes it easy to pick one object out of many. For example, you may want to find the blue line with square marker having blue face color.
You can also specify which figures or axes to search, if there is more than one. The following sections provide examples illustrating how to use findobj
.
Finding All Objects of a Certain Type
Since all objects have a Type
property that identifies the type of object, you can find the handles of all occurrences of a particular type of object. For example,
finds the handles of all line objects.
Finding Objects with a Particular Property
You can specify multiple properties to narrow the search. For example,
finds the handles of all red, dotted lines.
Limiting the Scope of the Search
You can specify the starting point in the object hierarchy by passing the handle of the starting figure or axes as the first argument. For example,
finds the string /2 only within the current axes.
Using findobj as an Argument
Since findobj
returns the handles it finds, you can use it in place of the handle argument. For example,
finds all red lines and sets their line style to dotted.
Setting Object Properties | Graphics User Interfaces |