importdata vs xlsread to read an excel file
59 views (last 30 days)
Evan on 1 Aug 2013
Edited: Evan on 5 Aug 2013
If you want to find out, try timing the operation of each function:
tic; xlsread('my_file.xlsx'); toc
tic; importdata('my_file.xlsx'); toc
I found that xlsread read in an excel file of 168 rows by 38 columns in 0.687730 seconds, while importdata took 3.690959 seconds.
If you want to read in your data more quickly, you could use a different file format, such as a txt or csv file. I attempted to read in the same data both saved as .xlsx and .csv, and this was my time difference:
Elapsed time is 0.001967 seconds.
Elapsed time is 0.630418 seconds.
So it looks like, for my purposes, csvread is the preferable option. But it all depends on the format in which your data already exists and the trouble you'd have to go to in order to convert it.