I have pretty simple question, but somehow I can't find an answer neither in google nor in matlab's help. So I have 2 folders with 200 files each, named with a certain pattern. First folder contains files, each of them has a corresponding file in the other folder. For example a pair of files:
Folder1: 2014-02-25_001_140225_111946 FFlC-1-1-100-0,55-114-315-0-3cm rms 2k.png
Folder2: Date=140225_Time=112038 FFlC-1-1-100-0,55-114-315-0-3cm avg 4k.jpg
The part FFlC-1-1...-3cm
is the same for both files.
So I read directory content with dir
into 2 structs, and then I can separate out the common part from the first filename into a string.
But how can I search this string among filenames from the other directory? In other words how can I search for a srting in a struct?
Filenames1=dir('....\photos1\*.png')
Filenames2=dir('....\photos2\*.jpg')
for i=1, length(Filenames1)
string=Filenames1(i).name(30:60)
pic= Filenames_2(find(string)) <-- but this does not work.
end
Well, actually it works, but instead of 1 filename it gives me 31 (1 correct, 30 incorrect). It looks like instead of using the whole string ('FFlC-1-1-100-0,55-114-315-0-3cm'), it takes the part before comma('FFlC-1-1-100-0').