the way to tackle this problem is to see if the above datetime array falls between the two dates (01-Sept-2015 00:00:00 till 5-Aug-2016 00:00:00), If it does then it should be displayed. How can I create that if condition? Once i have it displayed, it would be easy for me to plot on the chart
drawing a vertical line in a plot if it is contained in the range
2 次查看(过去 30 天)
显示 更早的评论
I have plotted a graph with the command line:
plot(x/y)
Variable x is a datetime array from 01-Sept-2015 00:00:00 till 5-Aug-2016 00:00:00. The distance between every x-value is 1 hour.
another datetime array z is defined as:
'01-Sep-2016 03:30:00'
'05-Oct-2016 02:30:00'
'01-Sep-2016 03:30:00'
'04-Aug-2016 03:30:00'
'05-Jul-2016 03:30:00'
I want the datetime array z to be drawn as red dotted vertical line in the plot graph if it is contained in the graph.
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Line Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!