I'm writing a script that needs to loop through all the .xls files in a folder and pull data from specific cells. I think xlsread
is capable of this, but I keep getting an error that reads:
Matlab:xlsread:filenotfound
Here is the basic structure of the code:
files = dir('C:\folder\folder\folder\*.xls');
channelinfo = 'C:\differentfolder\chanloc.type';
cnt = '.cnt';
condition = 'varriable';
for i = 1:length(files(:,1))
try
CNTCrash1WindowStart = xlsread(files(i).name, 'Summary', 'C8');
CNTCrashWindowEnd = xlsread(files(i).name, 'Summary', 'D8');
subjectNum = xlsread(files(i).name, 'User Info', 'A2');
eeglab;
%eeglab things happen here
catch ME
disp(ME)
end
end