MATLAB: Read Excel sheet (one after other )

excelloopsheet

hello… i have 15 Excel sheet in one file .. i want put them in loop to read in matlap How can i do that? thankyou..

Best Answer

The second output of xlsinfo can tell you the names of all of the sheets. You can then loop over them with xlsread
filename = 'YourInputFile.xls';
[~, sheets] = xlsinfo(filename);
num_sheets = length(sheets);
data = cell(num_sheets, 1);
for K = 1 : num_sheets
data{K} = xlsread(filename, sheets{K});
end