Ho w to find the first minimum element in a row

11 ビュー (過去 30 日間)
Chamira Wickramasinghe
Chamira Wickramasinghe 2015 年 3 月 2 日
Here i have a 1X6 matrix
y =
682.8333 399.8160 34.2270 46.1800 107.7035 21.5367
what i wanna do is to find the FIRST minimum element
which means if i plot "y" i wanna find first minimum turning point
for this example it must be 34.2270
Thank you.

回答 (2 件)

Adam
Adam 2015 年 3 月 2 日
pks = findpeaks( -y );
will work if you have the Signal Processing Toolbox.
If you don't you can find peak finding algorithms on the File Exchange that will do a similar job.
  1 件のコメント
Chamira Wickramasinghe
Chamira Wickramasinghe 2015 年 3 月 5 日
Thank you for the answer :)

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


Andrei Bobrov
Andrei Bobrov 2015 年 3 月 2 日
y = [682.8333 399.8160 34.2270 46.1800 107.7035 21.5367];
out = y(find(diff(y)>0,1,'first'));
  2 件のコメント
Chamira Wickramasinghe
Chamira Wickramasinghe 2015 年 3 月 2 日
Wow thank u so very much...
It worked :)
Maurício Girardi-Schappo
Maurício Girardi-Schappo 2019 年 6 月 26 日
This only works if it is a decreasing function for the first values of y...

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

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by