Owning Class: membership
Requires: MathScript RT Module
c = is_membermx(a, b)
c = is_membermx(a, b, 'rows')
[c, d] = is_membermx(a, b)
[c, d] = is_membermx(a, b, 'rows')
Legacy Name: ismember
Determines whether an element in one matrix is an element of another matrix. If you specify 'rows', a and b must have the same number of columns, and is_membermx(a, b, 'rows') determines whether the rows of a are in b.
| Name | Description |
|---|---|
| a | Specifies a matrix. |
| b | Specifies a matrix. |
| Name | Description |
|---|---|
| c | Returns a matrix of Boolean values. An element in c is 1 if and only if the corresponding element of a is a member of b. Otherwise, the element is 0. c is a matrix of the same size as a. c is a vector or matrix. |
| d | Returns the positions in b of the elements of a. If an element in a is not in b, the corresponding element in d is 0. d is a vector of integers. |
A = [1, 2, 3, 4, 5, 6, 7, 8, 9]
B = [2, 3, 5, 7]
C = is_membermx(A, B)