MATLAB Answers

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

2 ビュー (過去 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?

  0 件のコメント

Sign in to comment.

採用された回答

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 件のコメント

Birdman
Birdman 2018 年 2 月 15 日
You are welcome. You can officially thank me by accepting the answer.

Sign in to comment.

その他の回答 (1 件)

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

  0 件のコメント

Sign in to comment.

タグ


Translated by