Plotting only few indices over time series

Hi,
I wanted to highlighted with a different marker may be, over a plot only for a fewer indices over time series.
e.g. for a time series x having size(x) = 400 x 1
plot(x) first and highlight only set of indices y = [28,300,349,388,389] over the original curve.
I tried to find the solutions on mat exchange but couldn't. Any help would do please?

 採用された回答

Mathieu NOE
Mathieu NOE 2021 年 12 月 15 日

0 投票

hello
my 2 cents suggestion :
n = 1:500;
x = n.*(1+rand(size(n)));
ind = [28,300,349,388,389];
plot(n,x,'b',n(ind),x(ind),'dr','markersize',15);

2 件のコメント

BR
BR 2021 年 12 月 16 日
Brilliant, thanks.
Mathieu NOE
Mathieu NOE 2021 年 12 月 16 日
My pleasure !

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeTime Series Events についてさらに検索

質問済み:

BR
2021 年 12 月 15 日

コメント済み:

2021 年 12 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by