| MATLAB Central > MATLAB Newsreader > relational operator tolerences |
|
|
|
Subject: relational operator tolerences From: Brandon Moore Date: 21 Jul, 2010 18:30:22 Message: 1 of 12 |
|
Wondering if there is some easy way to adjust the tolerances on the relational operators (==, <, etc.) in MATLAB so I don't have things like sum([0.4 0.3 0.2 0.1])==1 come back false. I.e., I don't want to have to include a +tolerance or -tolerance term every time I use a relational operator in order for it to not have these sort of errors (or rather, to error more on the side of logical true instead of logical false). |
|
"Brandon Moore" <moorebj.nospamplease@umich.edu> wrote in message <i27ebu$mkb$1@fred.mathworks.com>... |
|
"Brandon Moore" <moorebj.nospamplease@umich.edu> wrote in message <i27ebu$mkb$1@fred.mathworks.com>... |
|
Subject: relational operator tolerences From: Brandon Moore Date: 21 Jul, 2010 18:53:04 Message: 4 of 12 |
|
> You could overload these with your own function. |
|
Subject: relational operator tolerences From: John D'Errico Date: 21 Jul, 2010 19:11:04 Message: 5 of 12 |
|
"Brandon Moore" <moorebj.nospamplease@umich.edu> wrote in message <i27ebu$mkb$1@fred.mathworks.com>... |
|
"Brandon Moore" <moorebj.nospamplease@umich.edu> wrote in message <i27fmg$huj$1@fred.mathworks.com>... |
|
"John D'Errico" <woodchips@rochester.rr.com> wrote in message <i27go8$q2s$1@fred.mathworks.com>... |
|
Subject: relational operator tolerences From: Walter Roberson Date: 21 Jul, 2010 19:21:47 Message: 8 of 12 |
|
John D'Errico wrote: |
|
Subject: relational operator tolerences From: Walter Roberson Date: 21 Jul, 2010 19:24:49 Message: 9 of 12 |
|
Andy wrote: |
|
"Andy " <myfakeemailaddress@gmail.com> wrote in message |
|
Here's a bit more embellished version of my last example that uses the |
|
Subject: relational operator tolerences From: Brandon Moore Date: 21 Jul, 2010 20:30:39 Message: 12 of 12 |
|
Walter Roberson <roberson@hushmail.com> wrote in message |
A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.
Anyone can tag a thread. Tags are public and visible to everyone.
| Tag Activity for This Thread | ||
|---|---|---|
| Tag | Applied By | Date/Time |
| matrixobj | Matt J | 21 Jul, 2010 16:21:54 |
