필터 지우기
필터 지우기

drawing a vertical line in a plot if it is contained in the range

조회 수: 2 (최근 30일)
AA
AA 2016년 11월 7일
답변: AA 2016년 11월 8일
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.

답변 (1개)

AA
AA 2016년 11월 8일
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

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by