필터 지우기
필터 지우기

timeseries - addevent plot problem (event ahead/too early)

조회 수: 1 (최근 30일)
Jonas
Jonas 2015년 2월 18일
편집: Jonas 2015년 2월 18일
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개)

카테고리

Help CenterFile Exchange에서 Time Series에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by