ind

Returns the indexes into the input where the input is True.


Synopsis

	function ind(
		larray[*] : logical
	)

Arguments

larray
A singly dimensioned logical array.

Description

ind returns the integer indexes where the input is True.

Example

The following demonstrates the usefulness of the ind function. Try running NCL and entering the following statements.
;
; Create sample array
;
	a = (/1,2,3,4,5,5,4,3,2,1,1,2,3,4,5/)
;
; Assign missing value
;
	a@_FillValue = 5
;
; Assigns 0 to locations that are missing values
;
	a(ind(ismissing(a))) = 0;

;
; Performs an expression on non-zero values
;
	a(ind(a.ne.0)) = -a(ind(a.ne.0)) * 2 + 1

Reference Manual Control Panel

NG4.1 Home, Index, Examples, Glossary, Feedback, Ref Contents, Ref WhereAmI?


$Revision: 1.6 $ $Date: 1998/06/15 21:29:45 $