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 Center および File ExchangeTime Series についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by