MathGroup Archive 2001

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

Search the Archive

Conversion of text into Mathematica expressions


Max, Try this:

In[1]:=mylist = {"2.5", "3.7", "7"}

Out[1]={"2.5", "3.7", "7"}

In[2]:=newlist = Map[ToExpression, mylist]

Out[2]={2.5, 3.7, 7}

The elements of the list are real numbers and can be manipulated using
various Mathematica functions e.g.

In[5]:=Apply[Plus, newlist]

Out[5]=13.2

Cheers,

Brian


  • Prev by Date: Re: MATHEMATICA WARNING
  • Next by Date: complex coefficients and rules...
  • Previous by thread: Re: Conversion of text into Mathematica expressions
  • Next by thread: Mystery of NonlinearFit