%% Check Existence of Folder
% Create the folder myfolder, and then check its existence as a folder.

mkdir myfolder;
exist myfolder dir

%
% If you specify the type as file, MATLAB® searches for both files and folders, therefore returning the same result.

exist myfolder file

% Copyright 2012 The MathWorks, Inc.