I have a code that gives user to select a directory that has image in it. Then the program takes other folders from one step behid. However, the program needs to check if there is any 'Bright' folder exists or not in 'parentFolder' directory. I tried this code but look like ~exist function can only take 'dir'. Is there any way to check folders from parentFolder directory?
Here is my code:
ImageFolder = uigetdir('D:\', 'Select Image Directory');
[parentFolder, thisFolder] = fileparts(ImageFolder);
fileListing = dir(parentFolder);
fileListing(ismember( {fileListing.name}, {'.', '..'})) = [];
areAFolder = [fileListing.isdir];
folderListing = fileListing(areAFolder)
if ~exist('Bright', parentFolder)
2 Comments
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/649653-folder-exists-check-in-another-directory#comment_1137968
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/649653-folder-exists-check-in-another-directory#comment_1137968
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/649653-folder-exists-check-in-another-directory#comment_1137988
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/649653-folder-exists-check-in-another-directory#comment_1137988
Sign in to comment.