Reference Guide > W Routines > WHEREINVEC Function
  

WHEREINVEC Function
Finds the vectors in a matrix that occur in a second matrix.
Usage
i = WHEREINVEC(b, c)
Input Parameters
b — (m,n) array.
c — (p,n) array.
Returned Value
i — Array of all indices j such that b(j,*) = c(k,*) for some k.
Keywords
 
note
For numerical data, a more efficient algorithm is used if keywords k and ck are not set.
k — (output) Array of all indices j such that c(j,*) = b(q,*) for some q.
ci — (output) The complement of i: array of all indices j such that b(j,*) c(k,*) for any k.
ck — (output) The complement of k: array of all indices j such that c(j,*) b(q,*) for any q.
bc — (output) Matrix of rows of b which are in c, i.e., b(i,*). This keyword is ignored if keyword k or ck is set.
zo — (output) An m-element array of 0's and 1's, where 1's indicate the rows of b which are in c. This keyword is ignored if k or ck is set.
 
note
A scalar -1 is returned if an output array would have no elements.
Example
b = RANDOMU(s,9,4)
c = RANDOMU(s,6,4)
c(0,*) = b(8,*)
c(2,*) = b(8,*)
c(5,*) = b(1,*)
i = WHEREINVEC( b, c, k=k, ci=ci, ck=ck )
PM, i, ' ', k, ' ', ci, ' ', ck
See Also
WHEREIN,  WHERE, alibIntersect

Version 2017.1
Copyright © 2019, Rogue Wave Software, Inc. All Rights Reserved.