www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/CheckExistenceOfFolderExample.m

    %% 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(R) searches for both files and
% folders, therefore returning the same result.
exist myfolder file