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

Find peak in the historgram data file - FORTRAN!

  1. Oct 6, 2009 #1
    Hello guys,

    I have a file with X Y values (separated by space)

    I want to scan the data to find the PEAK in the file. (It will probably be a lowest Y point...)

    How do I do this is Fortran?

    Thank you,

  2. jcsd
  3. Oct 7, 2009 #2


    User Avatar
    Science Advisor

    Seems like...
    Code (Text):

    DO n=1,nPts
      READ(11,*) x,y
    END DO
    peak_val = MINVAL(y)
    peak_loc = MINLOC(y)
    Can you elaborate a little more on this "peak" that you need to find? Do you need to take derivatives?
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook