Skip to content

ismembertol

set · scripts/set/ismembertol.m

tf = ismembertol (A, S)
tf = ismembertol (A, S, tol)
tf = ismembertol (..., "ByRows", tf, "DataScale", scale, "OutputAllIndices", tf)
[tf, loc] = ismembertol (...)

Test membership of A in S, treating values as equal when they differ by no
more than tol * DataScale.

The default tolerance is 1e-12 (1e-6 if either input is single) and the
default scale is the largest finite magnitude in A and S together.  NaN never
matches.  "loc" is the lowest index into S(:) (row of S with "ByRows") of a
matching element, or 0; with "OutputAllIndices" it is a cell array holding
every matching index.