MATLAB: Missing 2000 years on date from csv file.

data importMATLABmatlab function

Hi,
When I read date column from a csv file, Matlab lacks 2000 years on every single date row. For example on the csv file it is 01/01/2018, Matlab reads it 01/01/0018. I use the function 'readtable'. Do you have any explanation to this, or any idea on how to fix this error? It is important for me to store the loaded data in a table format as I use functions like 'timetable' and 'retime' afterwards. Thank you

Best Answer

Perhaps?
T=readtable('Treasury.csv');
a=strrep(string(T.Date),'0018','2018');
T.Date=a