フィルターのクリア

speed up xlsread

16 ビュー (過去 30 日間)
ricco
ricco 2011 年 11 月 24 日
コメント済み: farzad 2020 年 5 月 23 日
I have imported data from excel into matlab where I have several spreadsheets. I have used:
files = dir('*.xls');
%read data from excel into matlab
for i=1:length(files);
File_Name{i}=files(i,1).name;%Removes the file names from 'files'
[num{i},txt,raw] = xlsread(File_Name{i},'Ble min');
end
So, each cell refers to each spreadsheet. Is there a quicker way of doing this? I heard actxserver could be used, would this be the case for me here?
thanks

回答 (2 件)

Image Analyst
Image Analyst 2011 年 11 月 24 日

Karsten Reuß
Karsten Reuß 2017 年 12 月 5 日
編集済み: Karsten Reuß 2017 年 12 月 5 日
Small update on this one:
In versions of Matlab newer than 2013, readtable is much faster. I had some 300 files to import, xlsread took about 300 seconds, with actxserver about 100 seconds and with readtable 3 seconds.
You can then use table2cell, table2array, etc. to convert your data into cells and doubles.
  1 件のコメント
farzad
farzad 2020 年 5 月 23 日
>> tic;xls=xlsread(fname);toc;
Elapsed time is 2.230238 seconds.
>> tic;rdt= readtable(fname);toc;
Elapsed time is 2.156550 seconds.
>> tic;rdt= readmatrix(fname);toc;
Elapsed time is 2.511168 seconds.
It was a 14336 x 7 xlsx file. all numbers

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by