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

Re:Extracting units from a list of values

  • To: mathgroup at smc.vnet.net
  • Subject: [mg27425] Re:Extracting units from a list of values
  • From: bghiggins at ucdavis.edu (Brian Higgins)
  • Date: Sun, 25 Feb 2001 00:53:52 -0500 (EST)
  • Organization: The Math Forum
  • References: <9750ck$6ke@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Tom, Try this

In[18]:=
mylist = {1, 2*Pi, 3*E*Meter^2, 3.5*Meter^2/s, Pi*Meter, 
   3/Pi*1/s, 3.75}

In[19]:=DeleteCases[mylist, _?NumericQ*(x_.), {2}] /. x_Real -> 1

Out[19]={1, 1, Meter^2, Meter^2/s, Meter, 1/s, 1}

Cheers,

Brian


  • Prev by Date: Deriviation d/dt(x(t))
  • Next by Date: Hydrodybnamics of liquid and gas
  • Previous by thread: Re: Deriviation d/dt(x(t))
  • Next by thread: Re: Extracting units from a list of values