ishghandle
True for graphics object handles
Syntax
ishghandle(h)
Description
ishghandle(h)
returns an array that contains 1's where the elements of
h
are handles to existing graphics objects and 0's where they are
not. Differs from ishandle
in that Simulink® objects handles return false.
Examples
Test for Valid Graphics Object Handle
Create a plot. Test if the output p
is a valid graphics object handle.
x = 1:10; y = 1:10; p = plot(x,y);
ishghandle(p)
ans = logical
1
Version History
R2024b: Passing multidimensional array as input returns output of same size
Passing an array that has three or more dimensions as input returns an array of
the same size. Previously, ishghandle
returned a 2-D array when
the input had three or more dimensions. The higher dimensions were collapsed into
the second dimension. For example, if the input was a 2-by-4-by-5 array, the output
was a 2-by-20 array.
If you pass a scalar, 1-D, or 2-D array to either function, the output is the same size as in previous releases.
If you use nested calls to the all
or any
function, update your code to
use the "all"
argument instead of the nested function call to
preserve the shape of the output.
For example, this code returns a scalar logical value in R2024a. In R2024b, it returns a 1-by-1-by-4 array of logical values.
h = gobjects(2,3,4); all(all(ishghandle(h)))
To preserve the scalar output, call the all
function once
with the "all"
argument. The result is a scalar logical
value.
h = gobjects(2,3,4);
all(ishghandle(h),"all")
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)