Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: How to import data without losing much precision
Replies: 5   Last Post: Dec 3, 2012 9:44 PM

 Messages: [ Previous | Next ]
 Steven Lord Posts: 18,038 Registered: 12/7/04
Re: How to import data without losing much precision
Posted: Dec 3, 2012 5:10 PM

"Jeff " <spREMOVEHITSjeffAT@SIGNoptonline.net> wrote in message
news:k9j6fs\$ih3\$1@newscl01ah.mathworks.com...

*snip*

> Actually, I don't know how much precision I should preserve. My adviser
> has been characteristically slow to respond to my questions and I've
> learned that I need to keep working while waiting for his response. If I
> don't need that much precision, then hopefully I will have at least
> learned something valuable along the way.
>
> Maybe my real question should have been "How do I determine how much
> precision my version of Matlab has?"

Double arrays in MATLAB store data using standard IEEE 754 double precision.
Single arrays in MATLAB use standard IEEE 754 single precision.
Symbolic arrays from Symbolic Math Toolbox are generally arbitrary
precision, but make sure you don't limit yourself prior to the construction.
For instance:

t = 3^(1/3);
x1 = sym(t);
x2 = sym(3)^(1/3);

x1 and x2 will not be exactly the same as you can see with VPA. In the case
of x1 we took the cube root of 3 in double precision, while in the case of
x2 we converted 3 into a symbolic expression then took the cube root
symbolically.

--
Steve Lord
slord@mathworks.com
http://www.mathworks.com

Date Subject Author
12/2/12 Jeff
12/2/12 Steven Lord
12/3/12 Jeff
12/3/12 Steven Lord
12/3/12 Nasser Abbasi
12/3/12 Roger Stafford