I am trying to get the program to read the sheet names, filter the sheet names in the excel file and place all that fit the category in it's own array and then use that array as inputs for the sheet name in a for loop. I'm getting the following error:
Error using xlsread (line 139) Sheet argument must be a string or an integer.
file = 'file.xlsx';
[status,sheets] = xlsfinfo(file);
sheetmatch = strmatch('DLC',sheets);
cases = sheets(:,sheetmatch);
n = size(cases,2);
for i=1:n
s = cases(i);
new_s = strrep(s,'_','-');
t = xlsread(file,s,'E7:E12006')
fs = 1/(t(2,:)-t(1,:));
b1 = xlsread(file,s,'F7:F12006')
b2 = xlsread(file,s,'G7:G12006')
b3 = xlsread(file,s,'H7:H12006')
end;
so what it's telling me is that it's not seeing the variable s as a string. Is there a way to get it so that the variable s (which changes with each step of i) to be input as the string for the sheet name which i'm trying to call?
Current cases matrix: The current cases matrix is as follows:
Columns 1 through 3
'DLC_1' 'DLC_2' 'DLC_3'
Columns 4 through 6
'DLC_4' 'DLC_5' 'DLC1_6'
Column 7
'DLC_7'
Thanks, Travis