1

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?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
teepee
  • 2,620
  • 2
  • 22
  • 47

1 Answers1

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.

gnovice
  • 125,304
  • 15
  • 256
  • 359