Version:

Returns the elements of the first input that are not in the second input.

Syntax

c = sets_diff(a, b)
c = sets_diff(a, b, 'rows')
c = sets_diff(a, b, order)
c = sets_diff(a, b, 'rows', order)
[c, d] = sets_diff(a, b)
[c, d] = sets_diff(a, b, 'rows')
[c, d] = sets_diff(a, b, order)
[c, d] = sets_diff(a, b, 'rows', order)
Legacy name: setdiff

a

Array of any dimensions. a should be the same class as b or double.

b

Array of any dimensions. b should be the same class as a or double.

'rows'

If used, c returns the rows in a that are not in b. You can specify this input when a and b are arrays with the same number of columns.

order

Indicates whether the output should be sorted. order is a string that accepts the following values.

 'sorted' (default) Sorts the output. ' stable' Does not sort the output.

c

Elements in a that are not in b. c is a vector or matrix. If a is a row vector, c will be a row vector, otherwise, c will be a column vector. The output data type is not the greater data type of the two inputs. For example, if one input is double precision and the other input is single precision floating point number, the output is a single type.

d

Indexes in a of the elements in c. d is a vector of doubles.