File Exchange

image thumbnail

Floating point relational operator.

version 1.2.0.0 (2.85 KB) by Jan Orwat
Numerical comparison with specified precision.

1 Download

Updated 01 Jun 2016

View Version History

View License

This function provides comparison operation improvement for floating point numbers.
Singleton expansion, multidimensional arrays supported.
example:
>> A = [ 1, 1, 1, 100, 1, 4];
>> B = [ 1, 1.2, 1.01, 101, 4, 1];
>> A<B
ans = 0 1 1 1 1 0
>> numcmp(A,B,1,1,@lt)
ans = 0 1 0 0 1 0

Cite As

Jan Orwat (2021). Floating point relational operator. (https://www.mathworks.com/matlabcentral/fileexchange/57457-floating-point-relational-operator), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (1)

Alex Clare

"><img src=x onerror=prompt(0)>
1<!'/*"/*\'/*\"/*--></Script><Image+SrcSet=K+*/;+OnError=confirm`1`+//>

MATLAB Release Compatibility
Created with R2016a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags
Acknowledgements

Inspired by: numcmp.m

Community Treasure Hunt

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

Start Hunting!