Syntax
h=axesofgcf([h])
Input Parameter
h : | | handlo to graphics objects; default is gcf |
Output Parameter
h : | | handles as array (sorted descending) |
Examples
PLsample; axesofgcf, delete(ans(5))
Copyright 2018-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth
Algorithm (Workflow)
This algorithm is a MATLAB function named axesofgcf
that retrieves the handles to the axes objects within the current figure or a specified graphics object.
Input Parameters
- h: A handle to graphics objects. If not provided, the default is the current figure handle,
gcf
.
Output
- h: Handles to the axes objects within the specified graphics object.
Algorithm Steps
- The function begins by calling
getfuncparams
with the arguments 1
, varargin
, and gcf
. This function is assumed to process the input arguments and return a handle, defaulting to the current figure if no specific handle is provided.
- It retrieves the children of the specified graphics object using
get(h, 'Children')
. This returns all child objects of the handle h
.
- The function then uses
strcmp
to compare the 'Type' property of each child object to the string 'axes'. This creates a logical array b
where each element is true
if the corresponding child is an axes object.
- Finally, the function filters the children handles using the logical array
b
to return only the handles that correspond to axes objects.
Example Usage
The example PLsample; axesofgcf, delete(ans(5))
demonstrates how to use the function. It first runs PLsample
, then calls axesofgcf
to get the axes handles, and finally deletes the fifth axes object in the list of handles returned.
Algorithm explaination created using ChatGPT on 2025-08-18 22:21. (Please note: No guarantee for the correctness of this explanation)
Last html export of this page out of FM database by TL: 2025-09-21