Syntax
b=ispatch([h])
Input Parameter
h : | | graphics object handle, default is gco |
Output Parameter
Examples
SGfigure; h=[CPLplot(PLcircle(20)); SGplotalpha(SGbox,'g')]
ispatch(h)
Copyright 2012-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 function, ispatch
, determines if a given graphics object handle in MATLAB is a patch object. It is part of the SolidGeometry library and was introduced by Tim Lueth.
Input Parameters
- h: This is the graphics object handle. If no handle is provided, the function defaults to using the current graphics object, which is obtained using
gco
.
Output Results
- b: This is a boolean value. It returns
true
if the object is a patch, and false
otherwise.
Algorithm Steps
- Initialize
h
with the current graphics object using gco
.
- Check if there are any input arguments. If there is at least one argument, set
h
to the first argument provided.
- Use the
get
function to retrieve the 'Type' property of the graphics object handle h
.
- Compare the 'Type' property with the string 'patch' using
strcmp
.
- Return the result of the comparison as the output
b
.
Example Usage
The function can be used as follows:
SGfigure;
h = [CPLplot(PLcircle(20)); SGplotalpha(SGbox, 'g')];
ispatch(h);
This example creates a figure and plots a circle and a box. The ispatch
function is then used to check if the plotted objects are patches.
Algorithm explaination created using ChatGPT on 2025-08-18 22:31. (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