function val = eq(a,b)
%HANDLE/EQ

%   Copyright (c) 1984-98 by The MathWorks, Inc.
%   $Revision: 1.5 $  $Date: 1997/12/06 00:41:10 $
%   J.H. Roh & B.A. Jones 4-25-97.

S.type = '.';
S.subs = 'HGHandle';

if iscell(a) | length(a)>1
   aH = subsref(a,S);
   aH = [aH{:}];
else
   aH = a.HGHandle;
end
if iscell(b) | length(b)>1
   bH = subsref(b,S);
   bH = [bH{:}];
else
   bH = b.HGHandle;
end

val = aH == bH;
