Most effective way to read mulitple spreadsheets from .xlsx files

3 次查看(过去 30 天)
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

采纳的回答

Walter Roberson
Walter Roberson 2020-4-2
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Environment and Settings 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by