MATLAB: Changing numbers to actual dates

datetimetime series

So I have a set of data for example
A = [4 6 3 6 2 7 3 7 8 10]
with time steps
T = [0 28 56 91 119 147 161 175 203 231]
Where the timesteps correspond to months, so 0 is 7th july, 28 is 4th August and so on.
I can plot these graphs, but I would like the numbers to correspond to the actual dates. How can I do this?

Best Answer

>> DT=datetime(2018,7+T.',7)
DT =
10×1 datetime array
07-Jul-2018
07-Nov-2020
07-Mar-2023
07-Feb-2026
07-Jun-2028
07-Oct-2030
07-Dec-2031
07-Feb-2033
07-Jun-2035
07-Oct-2037
>>
Oooops! T (as I kinda' thought) isn't in months; it's days...so
>> DT=datetime(2018,7,7+T.')
DT =
10×1 datetime array
07-Jul-2018
04-Aug-2018
01-Sep-2018
06-Oct-2018
03-Nov-2018
01-Dec-2018
15-Dec-2018
29-Dec-2018
26-Jan-2019
23-Feb-2019
>>
Ah! That looks more realistic!