Loren on the Art of MATLAB

Results for: Numerical Accuracy

Arithmetic Associativity – Not So Fast 7

Posted by Loren Shure,

Arithmetic is associative, right? Well, in the world of paper and pencil, where you can often do calculations exactly, that can be true. However, in the computing world, where real numbers can't always be represented exactly because of working with finite precision datatypes, it turns out that you can't depend on the arithmetic to behave the way you were taught in grade school.... read more >>

How Many Digits to Write? 23

Posted by Loren Shure,

Recently, my colleague Rob Comer and I were talking about how to write out a number, in decimal, so that if it were read back into MATLAB, would retain its full precision. The question is how many digits to write out. ... read more >>

By All Means 2

Posted by Loren Shure,

Ever find yourself wanting to get some sense of some data, but not sure the arithmetic mean is what you want? You might also consider the geometric mean (geomean from Statistics Toolbox). In the image processing world, I understand that some think that images look crisper often when ... read more >>

Rounding Results 15

Posted by Loren Shure,

There are frequent questions on the MATLAB newsgroup about rounding results to a certain number of decimal places. MATLAB itself doesn't provide this functionality explicitly, though it is easy to accomplish. ... read more >>

These postings are the author's and don't necessarily represent the opinions of MathWorks.