readtable _causing slow operation

6 ビュー (過去 30 日間)
NN
NN 2021 年 5 月 24 日
回答済み: Walter Roberson 2021 年 5 月 25 日
Dear all,
Kindly let me know the if there is any option to use any other command instead of readtable to run the attached code.It takes so much of time and please let me know how i can effectively perform reading the data and convert to date num
Attached is the code:
Data=readtable('WMS.xlsx');
testdates = Data{1:end,1};
date_num = datenum(testdates);
date_num2 = datenum(testdates)+table2array(Data(1:end,2))./(24*3600);
  6 件のコメント
NN
NN 2021 年 5 月 24 日
Thank you very much for the suggestions.I am attaching the data sample.Please check this and advice.
Hiro Yoshino
Hiro Yoshino 2021 年 5 月 25 日
I often use
This may help you avoid importing unwanted data/variables from your table.

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

回答 (1 件)

Walter Roberson
Walter Roberson 2021 年 5 月 25 日
To read xlsx files, you have two built-in options on Mac and Linux, and one additional option on Windows:
  1. readtable() . For all sufficiently new versions of MATLAB, this invokes internal code in all operating systems, unless you give an option to disable that
  2. xlsread(). For Mac and Linux, this only ever uses internal code. For Windows that has Excel installed, it will attempt to use ActiveX to talk to Excel to do the work, and if that fails then it will use the internal code.
  3. For Windows only, you can use ActiveX or .NET to talk to Excel directly
The other possibilities, not built-in:
  • You can link to an external C or C++ library to do the work for you
  • You can invoke an external process to do the work for you
The same considerations apply for .xls files.
For text files, there would be additional possibilities.

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by