MATLAB: I had time 21:09 and i want to generate previous 10 time events like 21:08 to 20:59. so how to implement

MATLABplotting real time data and assign ticks of real time on x-axis

I used datenum but the difference between them is not same

Best Answer

the units of datenum are in days so you need to subtract by the fraction of day.
datestr(datenum('21:09')-1/24/60,15) %will return 21:08
so
datestr(datenum('21:09')-[0:10]/24/60,15)
will generate the past 10 times