Floating-point ISMEMBER (i.e., with round-off tolerance)


Updated 24 Oct 2010

View License

Matlab ISMEMBER uses strict exact comparison between floats.
The ISMEMBERF (note the "F") can tolerate some round off error.
It is possible to configure the tolerance.'rows' option is also supported.


[tf, loc]=ismember(0.3, 0:0.1:1) % returns false
[tf, loc]=ismemberf(0.3, 0:0.1:1) % return true

Cite As

Bruno Luong (2023). ISMEMBERF (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2006a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

Replace soon-deprecated strmatch with strncmpi

Complete H1 lines with specification of LOC and membership criteria

Correct bug reported by Jan, better description in H1 line (thanks)

Correct bug reported by David

Important change in the engine when using 'rows' option, which saves the runtime by about 30%. Some adjustment with automatic tolerance.

Extend ISMEMBERF to complex arrays