C = intersect(A, B)
[C, ia, ib] = intersect(A, B)
| Parameter | Description |
|---|---|
| A, B | Input arrays. |
| Parameter | Description |
|---|---|
| C | Sorted values common to A and B. |
| ia, ib | Index vectors into A and B. |
intersect(A, B) returns the sorted values that occur in both input arrays.
A = [5 7 1];
B = [3 1 1];
C = intersect(A, B)
| Version | Description |
|---|---|
| 2.0.0 | initial version |