Most effective way to read mulitple spreadsheets from .xlsx files

1 Ansicht (letzte 30 Tage)
Hi,
I am new to matlab and have written a code to analyse my data for my thesis. I have attached my current code which is very slow which I am now trying to optimise to make my analysis more effcient. It currently take 27 seconds to import all this data which is significantly slowing down this process.
I'm trying to import multiple excel spreadsheets from two .xlsx files inside the same folder. I would then like to assign specific variable names to the data within these spreadsheets.
Does anyone have recommendations such as a loop that I could use to import multiple spreadsheets quickly. Any suggestions would be much appreciated and thank you in advance for your help.
Max

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 2 Apr. 2020
If you must use xlsread() for some reason, then see
We recommend switching to readtable(), especially if you have R2019b or later (which by default will not invoke Excel)
In theory there are some performance improvements that could be made to reading in multiple sheets from the same file. .xlsx files are really ZIP files of a directory of XML files, and in theory you could avoid unziping the files each time. However that is not implemented.

Weitere Antworten (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by