I'm writing a function that pulls data from one directory, compares it's string name to another file in another directory and then runs processes on them both
So far things look like this
function matlabanswers_plzhelpeData= dir('C:/file/file/file/*.mat')for i = 1:numel(eData)eName = eData.namea=regexp(eName,'_','split');experimentName = a{1};load(eName)lData = dir('C:/differentfolder/*.mat')for n=1:numel(lData)lName = lData.nameif strcmp(lName,experimentName) ==1 load lName% run code using variables from both loaded eName and lName.mat files
elseendendend
For some reason this type of code works when I'm working out of one directory, but refuses to actually load the files if they are from different directories…
any idea of what I'm doing wrong?
Thanks ML
Best Answer