Next: , Previous: , Up: Internal Routines   [Contents][Index]


15.5.226 find

find(array, key [, offset] [, /exact, /index_ge, /value_ge, /first])

Finds the first occurrence of each element of key, starting at (the corresponding element of) offset in array. The search mode keywords are:

/exact

Seek exact match, return offset or -1 if none found.

/index_ge

Seek first element greater than or equal to the key. Return offset or -1, if none found.

/value_ge

Seek first element greater than or equal to the key. Return found element, or -1 if none found.

/first

Return a result for each combination of the second and higher dimensions.

e.g., if x is a 3 by 5 by 4 array, then find(x,[1,2]) returns the indices of the first occurrence of 1 and 2 in x, irrespective of the dimensional structure of x, and find(x,[1, 2],/first) returns a 2 by 5 by 4 array with the results of find(x(*,0,0),1), find(x(*,1,0),1), etcetera. key may be a scalar or an array. offset may be a scalar or an array of the same size as key.

See also: find_maxloc