timeseries - addevent plot problem (event ahead/too early)
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello community,
I have the following problem: I have to timeseries A and B. If I plot a single timeseries, the max-event (peak) is plotted at the right position, as shown with the code below:
ts1 = timeseries(A(:,2),A(:,1));
ts1.Name = 'Daily mean';
ts1.TimeInfo.Units = 't [days]';
ts1.TimeInfo.StartDate = datestr(min(A(1,1)));
ts1.TimeInfo.Format = 'dd - mm - yy';
ts1.Time = ts1.Time - ts1.Time(1); % Express time relative to the start date.
e1 = max(A(:,2));
e11 = find(e1==A(:,2));
ts1 = addevent(ts1,'Peak',ts1.Time(e11));
plot(ts1,'-b')
If I add the exact same, code with "hold on" and another matrix B the max-event of B will be plotted at the wrong position. As one can see in the figure below, the plot should be in the squared box to the upper right
However, if B is plotted individual, the max-event is plotted at the right spot.
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Time Series에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!