Comparison for existence of duplicate files in folder in MATLAB?

Status
Not open for further replies.

ganesh449

Junior Member level 1
Joined
Nov 30, 2010
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,417
Hi friends,
In my MATLAB project i have a scenario,in which i have to extract the features of an image and store all the files with a specified name in a folder.Now my issue is how can i know the existence of file name already in that folder.I need a MATLAB code for the comparison of file names in the folder.

My scenario:
I have a folder named Test.
i have files named Test1.mat,Test2.mat,Test3.mat,Test4.mat,Test5.mat
Now when ever i give the file name Test1.mat it has to show that file name already exists..



Thanks,
RVL.Ganesh.
 

if you are in the working directory how about:

sum(strcmp(cellstr(ls),'Test5.mat')

will return 1 if it exists, 0 otherwise
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…