How to make datenum more efficient for large arrays?
Show older comments
I am using textscan() to create an matrix that is 3,081,680 rows long. The very first column, A{1}, is the timestamp column, and it's elements look like this:
"2011-01-23 18:38:30"
I have tried using datenum() to convert this, but it is either taking too long or not working at all (longer than ten minutes). Is there a way I can make this more efficient?
Thanks!
Accepted Answer
More Answers (1)
Kelly Kearney
on 29 Oct 2013
Are you specifying the date format? Particularly for large arrays,
datenum(A{1}, 'yyyy-mm-dd HH:MM:SS')
will be much faster than
datenum(A{1})
Categories
Find more on Dates and Time in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!