function result = isdir(dirpath)
%ISDIR  True if argument is a directory.
%       ISDIR(DIR) returns a 1 if DIR is a directory and 0 otherwise.

%       P. Barnard 1-10-95
%       Copyright (c) 1995 The MathWorks, Inc.
%       $Revision: 1.5 $  $Date: 1995/05/11 14:39:30 $

curdir = cd;
catch = '0';
if eval(['cd(''' dirpath ''')'], catch)
   cd(curdir);
   result = 1;
else
   result = 0;
end
