How to select a group of consecutive (yet excluding weekends and holidays) dates between a certain date A and a certain date B from datetime?
2 次查看(过去 30 天)
显示 更早的评论
Hi, I have a column of datetime (business days from 2012 to 2019). From this datetime, I would like to select a group of dates between a certain date (dStart), and another certain date (dEnd).
For example, if dStart was 06-Nov-2012 and dEnd was 05-Dec-2012, I want to select all dates I have from the datetime, including dStart and dEnd.
I believe that there is a way to do this, but I don't know how to do it.
Could you please explain to me how to achieve this?
Thank you!!!
0 个评论
回答(1 个)
Guillaume
2019-7-31
%bus_dates: a datetime vector of all business dates between 2012 and 2019
%dStart: start date
%dEnd: end date
selected_dates = bus_dates(isbetween(bus_dates, dStart, dEnd))
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Time Series Objects 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!