MATLAB: How to import multiple .xlsx files all within the current directory in an organizational manner

importing excel data

I have tried many ways of importing multiple .xlsx files from my current directory but have been unable to import it so it can be used for data analysis. So my question is: Is it possible to be able to import multiple .xslx files (my files are only 1 column of data each) into Matlab in such a way that I could recall each file separately under a handle or a matrix so I can more quickly perform data analysis without having to continuously import data for each and then analyze? Any help would GREATLY be appreciated!

Best Answer

I don't understand what's your problem. Your approach for importing multiple files is correct.
You cannot have a "handle" to a file but you can store your imported data into a sructure (inside the loop):
data.(['a' num2str(k)]) = xlsread(allfiles{k})
Then in the analyses you can refer to data.a for a specific file.