I am working on a small project which requires huge amount of data to be imported into matlab for further processing. I have currently 15 excel files and each file has 8 sheets. What I want is to make a parent structure in which I want load each excel file as a structure e.g.
parentstructure.filename.value{}
Where parentstructure is a main structure and filename is an excel file which is an another structure in parent structure and each excel file has a 8 sheets in a cell.
I have written a small code to read data into matlab. The code is as follows
srcdir = ''; %%% where all the files are placed
srcfiles = dir(fullfile(srcdir, '*.xls'));
for p = 1:numel(srcfiles)
filename = fullfile(srcdir, srcfiles(p).name);
[~,sheets] = xlsfinfo(srcfiles(p).name);
for i = 1:8
Sheet = char(sheets(1,i)) ;
value{p,i} = xlsread(filename,Sheet);
end
end
This code works fine and loads the data into matlab but not in the structrue form I wanted. I tried several other combinations and adjustments but getting errors. Any help or guuide will be much appreciated. Thank you