function clruprop(handle, name)
%CLRUPROP Clear user-defined property.
%	CLRUPROP(H, NAME) clears the user-defined property NAME
%	of the figure or axes object specified by handle H, if it
%	exists.
%
%	See also: setuprop, getuprop.

%	Steven L. Eddins, October 1994
%	Copyright (c) 1995 by The MathWorks, Inc.
%	$Revision: 1.4 $  $Date: 1994/12/22 14:28:27 $

tryString = 'objType = get(handle, ''type'');';
catchString = 'failed = 1;';
failed = 0;

eval(tryString, catchString);
if (failed)
  error('H is not a valid handle.');
end

if (~strcmp(objType, 'figure') & ~strcmp(objType, 'axes'))
  error(sprintf('No user-defined properties for "%s" objects.', objType));
end

name = lower(name);

delete(findobj(handle, 'Tag', name));

