I have a matrix (V), which looks like this

```
         [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
[V1,]   37   15   30    3    4   11   35   31
[V2,]   44   31   45   30   24   39    1   18
[V3,]   39   49    7   36   14   43   26   24
[V4,]   45   31   26   33   12   47   37   15
[V5,]   23   27   34   29   30   34   17    4
[V6,]    9   46   39   34    8   43   42   37

```

I have another matrix (X)

```
         [,1] [,2] [,3] [,4] [,5] [,6] 
[X1,]   37   15   21    3    4   11   35   31
[X2,]   37   37   45   30   24   39    1   18
[X3,]   39   49    7   36   14   43   26   24
[X4,]   45   31   26   37   12   47   37   15
[X5,]   23   27   34   29   30   37   17    4
[X6,]    9   46   39   34    8   37   42   37

```

Now each row of matrix V should be matched with each row of matrix X to get a count matrix like 

```
  [,V1] [,V2] [,V3] [,V4] [,V5] [,V6] [,V7] [,8]
[X1,]   7      
[X2,]   

```

To check the common numbers between X1 and V1??

How do I do it using R? Please suggest me some ideas