MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Conversion of output


Christopher Mack [mack at tvt.tu-darmstadt.de] wrote:

> when using the NonlinearFit-function of Mathematica, I get an 
> output like 
> 
>  {a1 -> 0.00400772472374540367, a2 -> -1.90417580406264459*10^-6, 
>     a3 -> 499088.922439139537, a4 -> 1.31534993678125777*10^-9, 
>     a5 -> 7728.37550019371821}
> 
> I'd like to convert this output to a vector with five elements 
> (containing the values of a1 to a5 shown above). 
> 
> Can anybody tell me how to do this ?

Christopher,

Use ReplaceAll (/.) as follows:

In[1]:=
{a1, a2, a3, a4, a5} /. {a1 -> 0.00400772472374540367, 
    a2 -> -1.90417580406264459*10^-6, 
    a3 -> 499088.922439139537, a4 -> 1.31534993678125777*10^-9, 
    a5 -> 7728.37550019371821}

Out[1]=
{0.00400772472374540367, 
-1.90417580406264459*10^-6, 
    499088.922439139537, 
    1.31534993678125777*10^-9, 
    7728.37550019371821}

Tomas Garza
Mexico City


  • Prev by Date: Re: equaltity of lists
  • Next by Date: Re: Subscripts, Doh!!!
  • Previous by thread: Re: Conversion of output
  • Next by thread: Re: Conversion of output