numfiles = 54;
mydata=cell(numfiles,1);
grouped = xlsread('Group B File Info');
d=dir('Trial*.csv');
for i=1:length(mydata)
if d(i).bytes>10
mydata{i} = xlsread(d(i).name);
else
disp([d(i).name 'read failed'])
end
myfilename = sprintf('Trial%02d.csv', i);
mydata{i} = xlsread(myfilename);
That is my code and this is the error I am recieving:
Error using xlsread (line 247)
File C:\Users\Caz\Documents\MATLAB\coursework\Trial06.CSV not in Microsoft Excel Format.
Error in MatlabCoursework (line 23) mydata{i} = xlsread(myfilename); % import files into mydata
Trial06.CSV is in the folder in the same format as all the other trials, however it is blank which is why the if, else was added incase of a blank file.
How do I overcome this?