[ncl-talk] how to get min index within different sequences

Verena Lili verena.prick at gmail.com
Thu Sep 18 04:34:49 MDT 2014


Hallo,

Anyone can suggest how to get the index of the minimum values within
different
sequences:

e.g.:

 x = (/-3, -2, -1, 4, 5, 6, 0, -2, 5/)

 x at _FillValue=-999
 x = where(x.gt.3,x, x at _FillValue)  ; only x>3
 print(x)

Variable: x
(0)     -999
(1)     -999
(2)     -999
(3)     4
(4)     5
(5)     6
(6)     -999
(7)     -999
(8)     5

; then, how to get *index* pointing the minimum value within these two
sequences (3)-(5) and (8),
so that the out put will be index:

*3 and 8*

Thank you.


-- 
Regards,
Dr. Verena.
School of Marine and Atmospheric Sciences
Stony Brook University
homepage: http://www.somas.stonybrook.edu/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140918/994028ca/attachment.html 


More information about the ncl-talk mailing list