p = ancestor(h, type)
p = ancestor(h, type, 'toplevel')
| Parameter | Description |
|---|---|
| h | graphics object |
| type | a row vector character or cell of strings: |
| 'toplevel' | a row vector character: return the highest parent in the object hierarchy that matches the condition. |
| Parameter | Description |
|---|---|
| p | a graphics object or [] |
ancestor returns the handle of the specified object's ancestor of a given type.
f = figure();
ax = gca();
s = surf(peaks);
AX = ancestor(s, 'axes')
F = ancestor(s, 'figure')
R = ancestor(s, 'root')
| Version | Description |
|---|---|
| 1.0.0 | initial version |