关闭

matlab 判断是否handle

标签: matlabobjecttestingclassinputsun
2334人阅读 评论(0) 收藏 举报
分类:

ishandle - Test for valid graphics object handle

Syntax

ishandle(H)

Description

ishandle(H) returns anarray whose elements are 1 where the elements of H arevalid graphics or Sun Java objecthandles, and 0 where they are not.

Non-Graphics Object Handles

Use the isa functionto determine the class of MATLAB objects and use the isvalid handleclass method to determine the validity of handle objects. See Testing Handle Validity forinformation 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

isvalid (handle) - Is object valid handle class object

Syntax

Hl = isvalid(Hobj)

Description

Hl = isvalid(Hobj) returns a logical array(or scalar if Hobj is scalar) in which each elementis true if the corresponding element in Hobj isa valid handle. This method is Sealed, so you cannotoverride it in a handle subclass.


0
1

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:819963次
    • 积分:9253
    • 等级:
    • 排名:第1979名
    • 原创:147篇
    • 转载:318篇
    • 译文:0篇
    • 评论:33条
    文章分类
    最新评论