function hdfwarn(status)
%Use the last error generated by the HDF library as a warning.

%   Copyright 1984-2002 The MathWorks, Inc. 
%   $Revision: 1.1.6.2 $  $Date: 2004/02/01 22:04:22 $

if status==-1
  error_code = hdfhe('value',1);
  if strncmpi(hdfhe('string',error_code),'no error',8)
    msg = 'The NCSA HDF library reported an unknown error.';
  else
    msg = sprintf('The NCSA HDF library reported the following error: \n%s', ...
                  hdfhe('string',error_code));
  end
  warning('MATLAB:hdfwarn:generic', '%s', msg)
end
return;
