MATLAB: Import multiple excel sheets with multiple columns each into variables

importing excel data

Hey, I would like to import data from excel with multiple sheets. Every sheets has 2 columns and I would like to create a variable of every column in every sheet. How can I do this in Matlab?

Best Answer

You can use xlsread(xls_file,sheet_no) to read from particular sheet, refer documentation. It will return data in matrix form. Once you have that, use array indexing to extract individual columns ,Matrix(:,col) gives column 'col' of 'Matrix'.
Using xlsread, loop through all the sheets to get data from individual sheets.
Related Question