# How to find relative maximums and minimums of a sequence of points in list form?

jospercomp shared this question 1 year ago

l1=Sequence((i,sin(i)),i,0,10,0.01) maybe this? 1

Have you tried eg

`Max(x(l1))` 1

This is Maximum Absolute. I am looking for Maximum Relative list. Maximum Relative is where there are concavity down. Minimum Relative is where there are concavity up. 1

Max(Séquence(y(Elément(l1, i)), i, 1, 100))

Min(Séquence(y(Elément(l1, i)), i, 1, 100)) 1

This are only Maximum and Minimum Absolute. I want Maximum and Minimum Relative.  2

maybe this? 2

from rami's points other method

Files: foro.ggb 1

I like their methods because they are very interesting and complicated. I had thought of something like this; but it does not work for cases where there is noise in the data. This only worked with charts with smooth data.

Maximum Local Lists

RemoveUndefined(Sequence(If(y(Element(l1, i - 1)) < y(Element(l1, i)) ∧ y(Element(l1, i + 1)) < y(Element(l1, i)), Element(l1, i)), i, 2, Length(l1) - 1, 1))

Minimum Local Lists

RemoveUndefined(Sequence(If(y(Element(l1, i - 1)) > y(Element(l1, i)) ∧ y(Element(l1, i + 1)) > y(Element(l1, i)), Element(l1, i)), i, 2, Length(l1) - 1, 1)) 1

```noise in the data
```

Then you need to fit a curve with one of the Fit...() commands first