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,

    Alexander
     
  2. jcsd
  3. Oct 7, 2009 #2

    minger

    User Avatar
    Science Advisor

    Seems like...
    Code (Text):

    OPEN(11,file='inputfile.dat',form='formatted')
    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?
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Find peak in the historgram data file - FORTRAN!
Loading...