The day, month, and year numbers you input into DATETIME don'tneed to be within the normal ranges for those numbers (1 to 12 for month, 1 to 28/29/30/31 for day depending on the month, etc.) For instance, September 24th 2015 is the 267th day of the year.
>> datetime(2015, 1, 267)
ans =
24-Sep-2015
There issomeprecedence for this, including some in MATLAB itself.
A = magic(4);
A(5) % A only has 4 rows but this linear index wraps around and refers to A(1, 2)
Best Answer