I have 4 folders each consisting of several (>10) excel spreadsheets. How is it possible to extract the last worksheet of each spreadsheet into matlab. So that in matlab, the data will be such that a cell would represent a folder and within that cell you would have the contents of each folder i.e. the data from the last worksheet of each spreadsheet?
cheers
Use XLSFINFO function. It determines that the file is Excel spreadsheet, will give you the list of all worksheets in it, and also can detect the excel file format.
Once you know the last sheet name you can use XLSREAD to get the data from it.
Use DIR to collect the file names in your folders.
UPDATE
Check this script: