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

%   Copyright 1984-2000 The MathWorks, Inc. 
%   $Revision: 1.6 $  $Date: 2000/06/01 02:52:53 $
%   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;
