```Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: extract the exact value from an approximated variable
Date: Mon, 29 Dec 2008 20:57:02 +0000 (UTC)
Organization: Mitre Corp
Lines: 44
Message-ID: <gjbdiu\$2r8\$1@fred.mathworks.com>
References: <gjbb62\$7dg\$1@fred.mathworks.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1230584222 2920 172.30.248.37 (29 Dec 2008 20:57:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 29 Dec 2008 20:57:02 +0000 (UTC)
Xref: news.mathworks.com comp.soft-sys.matlab:509140

"Orchid Bee" <orchidbee08@yahoo.com> wrote in message <gjbb62\$7dg\$1@fred.mathworks.com>...
> hi, i am looking for a way to replicate the exact values that i get from a variable in matlab.
> i have a variable, fitmodel fm1, with the coefficients of the polynomial  that fit the data. if i use the symbolic values of these coefficients in a consequent equation i get different result than if i use the numeric values of the coefficients that are showed for these variables.
> supposing the case:
> Linear model Poly9:
>        fm1(x) = p1*x^9 + p2*x^8 + p3*x^7 + p4*x^6 +
>                     p5*x^5 + p6*x^4 + p7*x^3 + p8*x^2 + p9*x + p10
>      Coefficients (with 95% confidence bounds):
>        p1 =   8.32e-007  (8.257e-007, 8.383e-007)
>        p2 = -5.217e-005  (-5.25e-005, -5.185e-005)
>        p3 =    0.001308  (0.001301, 0.001315)
>        p4 =    -0.01684  (-0.01693, -0.01676)
>        p5 =      0.1189  (0.1183, 0.1195)
>        p6 =     -0.4585  (-0.461, -0.456)
>        p7 =      0.9485  (0.9422, 0.9547)
>        p8 =      -1.185  (-1.193, -1.176)
>        p9 =       1.063  (1.058, 1.068)
>        p10 =     -0.5639  (-0.565, -0.5629)
>
> i get different result if i use fm1.p1 than if i use 8.32/10^7.
> nonetheless i need to use the numerical data, not the variable itself; so i'd like to ask you about how can i extract the exact value of the variables?
> thank you so very much!
>
> Orchy

% If I understand, try

doc format

fm1.p1
format long
fm1.p1

% You will see many more digits displayed.

% By default (with format short), MATLAB displays only about 4 significant digits.
% Using format long dispalys about 3 times as many significant digits.

% format affects ONLY how the numbers are DISPLAYED.
% Not how MATLAB computes or stores the numbers.

% Or use the File -> Preferences -> Command Window option

```