ismember
Class: dataset
(Not Recommended) Dataset array elements that are members of set
The dataset
data type is not recommended. To work with heterogeneous data,
use the MATLAB®
table
data type instead. See MATLAB
table
documentation for more information.
Syntax
LiA = ismember(A,B)
LiA = ismember(A,B,vars)
[LiA,LocB]
= ismember(___)
Description
for LiA
= ismember(A
,B
)dataset
arrays A
and
B
returns a vector of logical
values the same length as A
.
The output vector, LiA
, has
value 1
(true) in the elements
that correspond to observations in
A
that are also present in
B
, and 0
(false) otherwise.
returns a vector of logical values the same length
as LiA
= ismember(A
,B
,vars
)A
. The output vector,
LiA
, has value
1
(true) in the elements that
correspond to observations in A
that are also present in B
for
the variables specified in
vars
only, and
0
(false) otherwise.
[
also returns a vector the same length as
LiA
,LocB
]
= ismember(___)A
containing the index to the
first observation in B
that
corresponds to each observation in
A
, or 0
if
there is no such observation. You can use any of
the previous input arguments.
Input Arguments
|
Query dataset array, containing the
observations to be found in
|
|
Set dataset array. When an observation in
|
|
String array or cell array of character
vectors containing variable names, or a vector of
integers containing variable column numbers.
|
Output Arguments
|
Vector of logical values the same length as
If you specify |
|
Vector the same length as
|