I want to make a time series from 2016/1/1 00:00 to 2016/12/30 00:00 with one hour difference

1 view (last 30 days)
Hamza Shahid
Hamza Shahid on 25 Jan 2022
Answered: Stephen23 on 25 Jan 2022
I have a time series of data of elevation of one year. the data is observed with one hour diiference. I want to make time series graph but dont have time column. How can i make the column of time of one year with one hour difference. For example 2016/1/1 00:00 than 2016/1/1 01:00 and so on till 2016/12/20 00:00.

Accepted Answer

Stephen23
Stephen23 on 25 Jan 2022
V = datetime(2016,1,1):hours(1):datetime(2016,12,20);
V = V(:)
V = 8497×1 datetime array
01-Jan-2016 00:00:00 01-Jan-2016 01:00:00 01-Jan-2016 02:00:00 01-Jan-2016 03:00:00 01-Jan-2016 04:00:00 01-Jan-2016 05:00:00 01-Jan-2016 06:00:00 01-Jan-2016 07:00:00 01-Jan-2016 08:00:00 01-Jan-2016 09:00:00 01-Jan-2016 10:00:00 01-Jan-2016 11:00:00 01-Jan-2016 12:00:00 01-Jan-2016 13:00:00 01-Jan-2016 14:00:00 01-Jan-2016 15:00:00 01-Jan-2016 16:00:00 01-Jan-2016 17:00:00 01-Jan-2016 18:00:00 01-Jan-2016 19:00:00 01-Jan-2016 20:00:00 01-Jan-2016 21:00:00 01-Jan-2016 22:00:00 01-Jan-2016 23:00:00 02-Jan-2016 00:00:00 02-Jan-2016 01:00:00 02-Jan-2016 02:00:00 02-Jan-2016 03:00:00 02-Jan-2016 04:00:00 02-Jan-2016 05:00:00

More Answers (0)

Products


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!