Be the first to rate this file! 142 downloads (last 30 days) File Size: 3.71 KB File ID: #21190

numcmp.m

by Carlos Adrian Vargas Aguilera

 

22 Aug 2008 (Updated 12 Sep 2008)

No BSD License  

Compares between numerical arrays up to a certain precision.

Download Now | Watch this File

File Information
Description

This program compares numerical arrays up to a certain precision.

Examples:
>> numcmp(x); % compares x==0.1
>> numcmp(x,'<=',y,3); % compares x<=y up to 0.001

See the screenshot for another example.

This is usefull to compare serial dates up to 0.1 seconds by using:
>> numcmp(time1*86400,FUN,time2*86400)
and avoiding floating point problems with the serial dates in days.

MATLAB release MATLAB 7.5 (R2007b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
12 Sep 2008

Fixed bug with Infs inputs

Tag Activity for this File
Tag Applied By Date/Time
floating point Carlos Adrian Vargas Aguilera 22 Oct 2008 10:15:40
round Carlos Adrian Vargas Aguilera 22 Oct 2008 10:15:40
compare Carlos Adrian Vargas Aguilera 22 Oct 2008 10:15:40
strcmp Carlos Adrian Vargas Aguilera 22 Oct 2008 10:15:40
mathematics Carlos Adrian Vargas Aguilera 22 Oct 2008 10:15:40
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com