setdiff
Class: dataset
(Not Recommended) Set difference for dataset array observations
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
C = setdiff(A,B)
C = setdiff(A,B,vars)
C = setxor(A,B,vars,setOrder)
[C,iA] =
setxor(___)
Description
for C
= setdiff(A,B
)dataset
arrays A
and
B
returns the set of
observations that are in A
but
not B
, with repetitions
removed. The observations in the dataset array
C
are sorted.
returns the set of observations that are in
C
= setdiff(A,B
,vars
)A
but not B
,
considering only the variables specified in
vars
, with repetitions removed.
The observations in the dataset array
C
are sorted by these
variables. The values for variables not specified
in vars
for each observation in
C
are taken from the
corresponding observation in A
.
If there are multiple observations in
A
that correspond to an
observation in C
, those values
are taken from the first occurrence.
returns the observations in C
= setxor(A,B
,vars
,setOrder
)C
in the order specified by
setOrder
.
[
also returns the index vector
C
,iA
] =
setxor(___)iA
such that C =
A(iA,:)
. If there are repeated
observations in A
, then
setxor
returns the index of the
first occurrence. You can use any of the previous
input arguments.
Input Arguments
|
Input dataset arrays. | ||||
|
String array or cell array of character
vectors containing variable names, or a vector of
integers containing variable column numbers.
Specify | ||||
|
Flag indicating the sorting order for the
observations in
|
Output Arguments
|
Dataset array with the observations that are
in |
|
Index vector, indicating the observations
from |