ismembertol
Members of a set within a tolerance.
📝Syntax
LIA = ismembertol(A, B)
LIA = ismembertol(A, B, tol)
[LIA, LOCB] = ismembertol(___)
📥Input Arguments
Parameter Description
A numeric array to test.
B numeric set to test against.
tol nonnegative scalar tolerance. The default is 1e-12 for double and 1e-6 for single inputs. The comparison uses tol scaled by the largest absolute value in A and B.
📤Output Arguments
Parameter Description
LIA logical array, true where an element of A is within tolerance of some element of B.
LOCB lowest index in B of a matching element, or 0 if none.
📄Description

ismembertol returns a logical array the same size as A, containing true where the elements of A are within tolerance of the elements of B. Two values u and v are within tolerance if abs(u-v) <= tol*max(abs([A(:);B(:)])).

💡Examples
[lia, locb] = ismembertol([1 2 3], [1.0000001 5 3], 1e-6)
🔗See Also
uniqueintersect
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub