indices/
mg_any.pro
includes main-level programRoutines
top mg_any
result = mg_any(condition [, indices=lonarr])
Determine whether any elements of an array of logical values is true.
Return value
0B or 1L
Parameters
- condition in required type=numeric array
array of conditions to check
Keywords
- indices out optional type=lonarr
array of indices of true values in
condition
Examples
For example, determine if there are any elements between 0.1 and 0.2 (or between 0.6 and 0.7):
IDL> x = randomu(seed, 10)
IDL> print, x
0.882556 0.573106 0.778631 0.663021 0.869744
0.026374 0.750390 0.655109 0.979332 0.512633
IDL> print, mg_any(x gt 0.1 and x lt 0.2)
0
IDL> print, mg_any(x gt 0.6 and x lt 0.7)
1
File attributes
Modification date: | Wed Jun 4 15:42:13 2014 |
Lines: | 9 |
Docformat: | rst rst |
Contact me if you have enhancement requests or bug fixes.