Why does formatting removal from Excel increase speed of MATLAB readtable?

夙愿已清 提交于 2019-12-24 08:44:43

问题


I have a spreadsheet with about 400 rows and 10 columns of data. I have it set up in MATLAB to import this sheet using readtable (since the data is not homegenous, I've found this to be the simplest method, over xlsread). The problem is, the formatting in the Excel file is causing the readtable function to be super slow. Both the number formatting (decimal places) and the conditional formatting are affecting this.

% With formatting: 35 seconds
% Without formatting: 1 second

I would like to be able to keep the formatting in the Excel file for visualization purposes but it seems to be causing issues. Any way to fix this without having to get rid of the formatting?


回答1:


You can try changing the 'Basic' parameter to true when loading your Excel file using readtable:

dataTable = readtable('your_file.xls', 'Basic', true);

When reading in basic mode, support for interactive features (such as formulas and macros) is disabled. This should give you a speed up if all you want is the data and nothing else.



来源:https://stackoverflow.com/questions/44337504/why-does-formatting-removal-from-excel-increase-speed-of-matlab-readtable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!