Finding Min and Max of a sinusoidal function
Ältere Kommentare anzeigen
Hi,
So I have the following code and I want to find the min and max of the function. I tried using 'xmin' and 'ymin' but it outputs all of the values instead of the ones I am looking for. Based off the plot I should be getting 4 xmin and 4ymin points as well as 3xmax and 3ymax points.
Anything would help! Thanks.
1 Kommentar
Walter Roberson
am 3 Apr. 2019
You define
fv = 1:n;
What is it that you expect
minx = min(fv,fv(:,1))
to return?
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 3 Apr. 2019
Bearbeitet: Walter Roberson
am 3 Apr. 2019
0 Stimmen
findpeaks(x,y) for the maxima, and findpeaks(x,-y) for the minima.
Kategorien
Mehr zu Descriptive Statistics finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!