I checked similar questions asked and it seems like the previous answers aren't quite what I am looking for. I have a csv file with a column of date and time. The dates are all mm/dd/18 not mm/dd/2018 so the years read into matlab as 18 not 2018. How can I add 2000 to the year in my timestamps (after importing to matlab). I tried using the addtodate function to add 2000 years (see below) but I got an error that says "Date number must be a numeric scalar." I'm not sure which value is my date number. I am sure there are several ways to do this. I am just looking for a straightforward way to save my year data correctly so that the matlab timestamps are correct. Thank you!
I have also attached the csv file here.
mba = readtable('2018_irradiance.csv'); irrad = mba.PAR; timestamp = datenum(mba.PST); times = addtodate(timestamp, 2000, 'year');
Best Answer