Best way to find local minimum and maximum (where derivatives = 0) without using toolboxes?

9 ビュー (過去 30 日間)
Hi,
I want to find the local maximums and minimums of a data set. I do not have any toolbox. Is there any way to do that except comparing every value with the next and previous values?
Thanks.
  2 件のコメント
Alasdair Gerrard
Alasdair Gerrard 2016 年 12 月 2 日
Is your data in an array? If so you can use max('your data') and min('your data'). Or are you interested in the rate of change max and min (i.e. where the derivatives are 0)?
Shar
Shar 2016 年 12 月 2 日
Yes, I do not want only one max and one min I want the to know where the derivatives are 0.

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

採用された回答

KSSV
KSSV 2016 年 12 月 2 日
YOu can use min and max. Also you can sort the array using sort either ascending or descending and pick either first or last respectively.
  2 件のコメント
Shar
Shar 2016 年 12 月 2 日
I do not want only one max and one min I want the to know where the derivatives are 0.
KSSV
KSSV 2016 年 12 月 2 日
Use diff(y)./diff(x) to get the derivatives and see where they are zero.

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

その他の回答 (1 件)

Andreas Goser
Andreas Goser 2016 年 12 月 2 日
It very much depends on the nature of your signal. Assuming this is measured data, you might want to filter noise first. There are multiple ways to do so. Then, the signal might have only very few local maxima or many. Depending on this and the topology, you might want to do some curve fitting first. Making a calculation with "derivatives being 0" - also very tricky. E.g. in a 12V signal and 1Hz frequency, is an increase from 7.9 Volt to 8.0 V a relevant increase, or pretty much flat for you. This means you would not compare with differences of exact zero, but within a bandwidth.
Saying all that, a lot of smartness is in the toolboxes for that purpose. Consider using them and not re-invent the wheel.
  2 件のコメント
Shar
Shar 2016 年 12 月 2 日
That is correct! How can I do it?
Andreas Goser
Andreas Goser 2016 年 12 月 2 日
Which of all my points? :-D

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

カテゴリ

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