how to find and mark the value of local minimums in a graph of multiple data ?

1 回表示 (過去 30 日間)
reema shrestha
reema shrestha 2018 年 2 月 15 日
回答済み: Chris Turnes 2018 年 2 月 15 日
I have a graph of multiple data taken experimentally. Now I want to find the troughs of the graph. I want to show the value of local minimas in the graph. How do I do it?

採用された回答

Birdman
Birdman 2018 年 2 月 15 日
Try this:
x=randi([1 7],1,10);
y=randi([3,10],1,10);
plot(x);hold on;plot(y);
[~,idxX]=findpeaks(-x);
[~,idxY]=findpeaks(-y);
plot(idxX,x(idxX),'o');plot(idxY,y(idxY),'o')
hold off;
  2 件のコメント
reema shrestha
reema shrestha 2018 年 2 月 15 日
thanks :)
Birdman
Birdman 2018 年 2 月 15 日
You are welcome. You can officially thank me by accepting the answer.

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

その他の回答 (1 件)

Chris Turnes
Chris Turnes 2018 年 2 月 15 日
If you have access to R2017b, you might also consider checking out the islocalmin function.

カテゴリ

Help Center および File ExchangeDirected Graphs についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by