Skip to Main Content Skip to Search
Product Documentation

ishandle - Test for valid graphics object handle

Syntax

ishandle(H)

Description

ishandle(H) returns an array whose elements are 1 where the elements of H are valid graphics or Sun Java object handles, and 0 where they are not.

Non-Graphics Object Handles

Use the isa function to determine the class of MATLAB objects and use the isvalid handle class method to determine the validity of handle objects. See Testing Handle Validity for information on testing for MATLAB handle objects.

Examples

Ensure that an input argument is the handle to a graphics object.

function updateLine(h,x,y)

   if ishandle(h)
      set(h,'XData',x,'YData',y)
      ...
   else
      line('XData',x,'YData',y);
      ...
   end
end

See Also

findobj | gca | gcf | gco | isa | set

How To

  


Free MATLAB Interactive Kit

Explore how to use MATLAB to make advancements in engineering and science.


Download free kit

Trials Available

Try the latest version of MATLAB and other MathWorks products.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS