MATLAB Answers

read csv file with dates and numerical in R2016b

1 view (last 30 days)
Simon Lind
Simon Lind on 30 Apr 2021
Commented: Simon Lind on 1 May 2021
I have a csv data file like this:
2014-01-01 01:30:00,5.728,100.0,
2014-01-01 02:00:00,5.892,100.0,
2014-01-01 02:30:00,6.0120000000000005,100.0,
2014-01-01 03:00:00,5.982,100.0,
2014-01-01 03:30:00,6.122999999999999,98.277,
2014-01-01 04:00:00,6.02,98.09,
2014-01-01 04:30:00,5.763999999999999,97.54899999999999,
2014-01-01 05:00:00,5.406000000000001,96.83200000000001,
2014-01-01 05:30:00,5.162999999999999,96.961,
2014-01-01 06:00:00,5.109,97.315,
Is there any way to import both the dates and numerical values?
Thank you

Accepted Answer

Cris LaPierre
Cris LaPierre on 30 Apr 2021
  7 Comments

Sign in to comment.

More Answers (1)

Jeremy Hughes
Jeremy Hughes on 30 Apr 2021
Try this:
opts = detectImportOptions(filename)
T = readtable(filename,opts);
  2 Comments

Sign in to comment.

Products


Release

R2016b

Community Treasure Hunt

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

Start Hunting!