Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Members of set within tolerance

`LIA = ismembertol(A,B,tol)`

`LIA = ismembertol(A,B)`

```
[LIA,LocB]
= ismembertol(___)
```

`[___] = ismembertol(___,Name,Value)`

returns
an array containing logical `LIA`

= ismembertol(`A`

,`B`

,`tol`

)`1`

(`true`

)
where the elements of `A`

are within tolerance of
the elements in `B`

. Otherwise, the array contains
logical `0`

(`false`

). Two values, `u`

and `v`

,
are within tolerance if

`abs(u-v) <= tol*max(abs([A(:);B(:)]))`

That is, `ismembertol`

scales the `tol`

input
based on the magnitude of the data.

`ismembertol`

is similar to `ismember`

.
Whereas `ismember`

performs exact comparisons, `ismembertol`

performs
comparisons using a tolerance.

`[___] = ismembertol(___,`

uses
additional options specified by one or more Name-Value pair arguments
using any of the input or output argument combinations in previous
syntaxes. For example, `Name,Value`

)`ismembertol(A,B,'ByRows',true)`

compares
the rows of `A`

and `B`

and returns
a logical column vector.