Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1556
News FAQ
Search Home


next up previous contents index
Next: max_with_location - Function Up: mathematics - Module Previous: median - Function


range_with_location - Function



Package utility
Module mathematics


Determine locations of min and max for a set of numbers


Synopsis
range_with_location(data, min_location, max_location, mask)



Description
range_with_location not only determines the minimum and maximum values in an array, it also tells you where the minimum and maximum values are located. If the minimum (/maximum) value ocuurs more than once, the first location is returned.



Arguments

data   The array to search
min_location   Position of the minimum value
max_location   Position of the maximum value
mask   If set, only consider locations where mask==True
    Allowed: bool array
    Default: null


Returns
[min,max]


Example
- include "statistics.g"
- r := range\_with\_location([1:5], minloc, maxloc)  
- print r, minloc, maxloc                         
[1 5]  1 5
- r := range_with_location([1:5], minloc, maxloc, [F,T,T,T,F])
- print r, minloc, maxloc                                      
[2 4]  2 4



See Also
min, max, range built-ins, min_with_location





next up previous contents index
Next: max_with_location - Function Up: mathematics - Module Previous: median - Function   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-10-15