xlread is too slow

7 visualizzazioni (ultimi 30 giorni)
Abilash Subbaraman
Abilash Subbaraman il 18 Ott 2016
Risposto: Steven Lord il 19 Ott 2016
x55 = xlsread('E:\OneDrive\Documents\Abilash\Academic\UCB\CBE 154\04 Centrifugal Pump\CP Data.xlsx','Sheet1','G2:G10');
y55 = xlsread('E:\OneDrive\Documents\Abilash\Academic\UCB\CBE 154\04 Centrifugal Pump\CP Data.xlsx','Sheet1','M2:M10');
x50 = xlsread('E:\OneDrive\Documents\Abilash\Academic\UCB\CBE 154\04 Centrifugal Pump\CP Data.xlsx','Sheet1','G11:G18');
y50 = xlsread('E:\OneDrive\Documents\Abilash\Academic\UCB\CBE 154\04 Centrifugal Pump\CP Data.xlsx','Sheet1','M11:M18');
x40 = xlsread('E:\OneDrive\Documents\Abilash\Academic\UCB\CBE 154\04 Centrifugal Pump\CP Data.xlsx','Sheet1','G19:G26');
y40 = xlsread('E:\OneDrive\Documents\Abilash\Academic\UCB\CBE 154\04 Centrifugal Pump\CP Data.xlsx','Sheet1','M19:M26');
x30 = xlsread('E:\OneDrive\Documents\Abilash\Academic\UCB\CBE 154\04 Centrifugal Pump\CP Data.xlsx','Sheet1','G27:G30');
y30 = xlsread('E:\OneDrive\Documents\Abilash\Academic\UCB\CBE 154\04 Centrifugal Pump\CP Data.xlsx','Sheet1','M27:M30');
Hi
I have a xlsread code like the one shown above. It is an excel sheet of about 2mb size with data from A1 to about AA100. The code takes forever to run and read the data. How do i speed it up and solve this is issue

Risposte (3)

Walter Roberson
Walter Roberson il 18 Ott 2016
If you are using R2016b or later then you might not be able to do any better.
If you are using R2016a or previous, and you are using MS Windows with Excel installed, then get the File Exchange contribution xlsread1()

Image Analyst
Image Analyst il 19 Ott 2016
It was R2015b where they first changed how the Excel functions worked. With that version and later, Excel is launched but not shutdown. it stays in the background which makes subsequent calls to xlsread() or xlswrite() faster. They made more speedups in subsequent versions.
You might also try readtable(). That's been speeded up too. So, basically, make sure you have the latest version.
Of course you can program it yourself in ActiveX if you want (like I do).

Steven Lord
Steven Lord il 19 Ott 2016
Your file is located in OneDrive? Try moving the file to your local hard drive and see if that improves performance.

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by