Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2001
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

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

Search the Archive

Conversion of text into Mathematica expressions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg28200] Conversion of text into Mathematica expressions
  • From: bghiggins at ucdavis.edu (Brian Higgins)
  • Date: Wed, 4 Apr 2001 04:13:23 -0400 (EDT)
  • Organization: The Math Forum
  • References: <9a966h$gu3@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

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