2018 release: Slow xlsread

조회 수: 14 (최근 30일)
amatuercoder
amatuercoder 2019년 1월 15일
답변: Ryan Jones 2019년 10월 7일
It seems that the xlsread function has slowed down considerably in the 2018 releases of MATLAB. Is this a known issue? Are there plans to improve it?
  댓글 수: 3
amatuercoder
amatuercoder 2019년 1월 15일
Nothing has changed other than the MATLAB release. Going from 2017b to 2018a (and continued into 2018b), it seems to take about twice as long to load data using xlsread. I know this because it is a feature that I use daily via software I wrote using the app developer. Its not like it takes 10 minutes to import the data or anything, but relative to computation using the imported data its a considerable amount of time. Currently, the importing takes about as long as the calculation itself. This was not the case in previous releases.
generally called as: A = xlsread('filename.xlsm','sheetname',range,'basic'), also called mutiple times in a row. Maybe this is what is slowing it down somehow?
Yes, MSoffice is installed
Yes, file is on a local disk
Not sure how to answer "which machine"? A high-end laptop running Windows 10?
Really I'm just curious is something was changed internal to the xlsread function that may have caused this, and if there are any plans to improve it in the future?
Jan
Jan 2019년 1월 15일
편집: Jan 2019년 1월 15일
The public forum has no knowledge about what MathWorks plans to modify in the future. Did you contact them already directly?
If the relative time of import and computing has changed, maybe R2018b computes much faster, while xlsread stayed at the same speed. Please clarify te details. Run some tests with importing the files under te different releases. An impression about the "relative speeds" of processing a data import does not allow to draw unique clues aboud the absolute times.

댓글을 달려면 로그인하십시오.

답변 (3개)

Guillaume
Guillaume 2019년 1월 15일
I'm just curious is something was changed internal to the xlsread function
It's not something that can be answered by us. We're generally not told about what goes on internally at Mathworks and even if we were it would most likely be covered by a non-disclosure agreement. As Jan said, for this sort of questions you're better off asking Mathworks support directly.
I note that you use the 'basic' mode of xlsread. This mode uses an internal parser developed by mathworks (I assume), it does not rely at all on Excel to obtain the data (so whether MSoffice is installed doesn't actually matter). It's very much possible that Mathworks have made some change to that parser (probably to make it more reliable which maybe would make it slower) particularly as it looks like it will become the default mode for readtable in a future release. See the release notes about functionality change of UseExcel. But again, that's all conjecture, contact Mathworks to know for sure.

Jeremy Hughes
Jeremy Hughes 2019년 1월 15일
Is this happening with all files?
You should contact MathWorks support and include an example file for which reading has slowed down.
Also, do try READTABLE with the UseExcel=false setting. For many files, this is much faster as it doesn't launch the excel process.

Ryan Jones
Ryan Jones 2019년 10월 7일
I'm not sure why it may of slowed down, but I can say that for me it was much faster to use readtable with opts. In my case I was only reading a single cell located in the same place in many sheets.
opts = spreadsheetImportOptions('Sheet',1,'DataRange','B3:B3');%I put opts outside of my for loop
a = readtable(filetoread(i),opts,'useexcel',false);
myCellArray{i}= a.Var1{1}
vs
[~,~,tempCellArray] = xlsread(filetoread(i),1,'b3:b3','basic');
I did the above operations on 131 Files. readtable took 124s and xlsread took 716s

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by