How to pick specific points and mark them on a plot?

3 ビュー (過去 30 日間)
Marian
Marian 2013 年 10 月 15 日
コメント済み: Marian 2013 年 10 月 16 日
Hi, I currently have an array that is finding temperature differences between two sets of quality controlled data. I have no problem finding these temperature differences and plotting them, but I'd like to know if there is a way for me to mark where there is at least a one degree difference? so:
%temp is time series object with temperature differences
plot(temp)
for i=1:length(temp)
if temp(i)>1 temp(i)<-1
((mark this on the plot))
end
end
Thanks!

回答 (1 件)

Vivek Selvam
Vivek Selvam 2013 年 10 月 15 日
Hi Marian
Add this snippet:
hold on;
plot(i,temp(i),'*')
  1 件のコメント
Marian
Marian 2013 年 10 月 16 日
It appears to be plotting the timeseries and then plotting the '*' further down the axis, instead of on top of the time series. Is there any way I can "get" the elements of the timeseries itself? In other words, instead of using temp, could I use my time series object for temp, ts5, in this for loop? It tells me I cannot just use ts5(i), as it is an undefined function for time series.

サインインしてコメントする。

カテゴリ

Help Center および File Exchange2-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