MATLAB Answers


How to create a only a time vector starting 13:15:00 to 20:59:00 with 1 minute interval? R2016a

Asked by NS
on 11 Dec 2018
Latest activity Commented on by NS
on 12 Dec 2018
I already have a DATE series and i need to create a time series wiith equally spaced 1 minute interval from 13:15:00 to 20:59:00 and attach it with DATE series. How to Create such time series and then attach them with DATE data.


Sign in to comment.




1 Answer

Answer by Chad Greene
on 11 Dec 2018
 Accepted Answer

This is a datetime for today, starting at 13:15 and going to 20:59, in 1 minute [1/(24*60)] intervals.
t = datetime(2018,12,11,13,15,0):1/(24*60):datetime(2018,12,11,20,59,0)
And to check:
>> t(2)-t(1)
ans =


Show us the interp1 call you tried (along with the code to create a small sample of data that we can use to run that interp1 call) and we may be able to help you figure out how to get it to do what you want.
Sir I have attached a sample data whherein my first column is DATETIME which are cleaned for non trading hours, holidays and weekends, outliers and second column is PRICE.
My purpose is to get all MINUTES between 13:15 to 20:59 on all DATES in cleaned sample DATES and interpolate the PRICES . I have tried -
But I am not getting desired result . Kindly help . I have attached sample data in excel.

Sign in to comment.