MATLAB: Get maxima and minima over certain period

MATLABvectors

Hi,
I'm trying to obtain the orbital eccentricity of the inner planets of the Solar System in time. To do that I need the aphelion and perihelion for every period. The distances to the origin are plotted in the figure, which have different orbital periods. Is there an easy way to obtain the eccentricity of every planet after every period? All I have available are 4 vectors with the distances and one with the time. Hope it's all clear.
Thanks.

Best Answer

Raead about findpeaks and envelope.
Related Question