After a simpler trial run with excel, I identified the problem: my excel is using the 1904 date system (the default date number for excel starts at 1904).
This is still intriguing for me that MATLAB imports the excel information as date number although in excel I already clearly specified the cell formate is a date format of yyyy/MM/dd
Solution:
You could change excel to 1900 date system but that only results in my data in excel switch to 2008. I prefer doing this in MATLAB.
what I did:
- Excel still uses 1904 date system so it is showing me the correct date (2012 -)
- Switch Excel cell format to 'General' - so it will give you a date number, which means the days after 1904-01-01
- Go to matlab, import the data as double
- convert datenum to datetime with the code below:
RC_datenum = table2array(RC_table(:,2)) + datenum(1904, 01, 01); % MAC excel default 1904 system
RC_time = datetime(RC_datenum, 'ConvertFrom', 'datenum');