I am trying to compare two filenames. I've assigned the filenames to varialbles, and I'm trying to compare the file names, if they match i need to perform some functions, if they do not match i need to skip.
Here's my code. It's inefficient, but It does what I need right now and I don't have time to go back and make it better.
Data = fullfile(file,'Data')
for i = 1:length(contents)
[null,fName,fExt] = fileparts(contents(i).name);
samplefile = readcell(fName);
file2 = fullfile(Data,'*.txt');
specontents = dir(file2);
SampleID = cell2mat(samplefile(7,1))
for k = 1:length(specontents)
[null, fName1, fExt1] = fileparts(specontents(k).name);
specimenfile = readcell(fName1);
SpecID = cell2mat(specimenfile(3,2))