legacy/IDLv4tov5/
match.pro
top match
match, a, b, suba, subb, COUNT=COUNT
NAME: MATCH PURPOSE: Routine to match values in two vectors. CALLING SEQUENCE: match, a, b, suba, subb, [ COUNT = ] INPUTS: a,b - two vectors to match elements OUTPUTS: suba - subscripts of elements in vector a with a match in vector b subb - subscripts of the positions of the elements in vector b with matchs in vector a. suba and subb are ordered such that a[suba] equals b[subb] OPTIONAL KEYWORD OUTPUT: COUNT - set to the number of matches, integer scalar SIDE EFFECTS: !ERR is set to the number of matches, can be used instead of COUNT RESTRICTIONS: a and b should not have duplicate values within them. You can use rem_dup function to remove duplicate values in a vector EXAMPLE: If a = [3,5,7,9,11] & b = [5,6,7,8,9,10] then IDL> match, a, b, suba, subb, COUNT = count will give suba = [1,2,3], subb = [0,2,4], COUNT = 3 and suba[a] = subb[b] = [5,7,9] HISTORY: D. Lindler Mar. 1986. Fixed "indgen" call for very large arrays W. Landsman Sep 1991 Added COUNT keyword W. Landsman Sep. 1992 Fixed case where single element array supplied W. Landsman Aug 95 Converted to IDL V5.0 W. Landsman September 1997
Parameters
- a
- b
- suba
- subb
Keywords
- COUNT
File attributes
Modification date: | Tue Oct 1 14:16:37 2013 |
Lines: | 109 |