Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Mathematica Question: Finding local maximums

  1. Nov 8, 2009 #1
    Hi all! This is a generic Mathematica question, which hopefully someone can help me with! :)

    I have a set of data points.
    I have an interpolating function from those points.
    I have a graph of that interpolation function.

    The graph goes like Sin^2, and has about 10 peaks. I want to have Mathematica find those 10 peaks. FindMaximum only finds 1 peak. How can I get it to find all 10?
    Last edited: Nov 8, 2009
  2. jcsd
  3. Nov 12, 2009 #2


    Staff: Mentor

    I would use:

    Union[Table[FindMaximum[f[x], {x, xInit}], {xInit, xMin, xMax, xStep}]]
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook