MathGroup Archive 2004

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

Search the Archive

Re: Extracting Coefficients and Powers

  • To: mathgroup at smc.vnet.net
  • Subject: [mg48275] Re: Extracting Coefficients and Powers
  • From: bghiggins at ucdavis.edu (Brian Higgins)
  • Date: Thu, 20 May 2004 04:03:55 -0400 (EDT)
  • References: <c8f8u8$fd4$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Bruce,

Will this work for you:

expr = x^3.2 + 5 - 3 / x^5.2 - x^5 + 2x


{coeff,expon}=Transpose[Cases[expr,b_?NumericQ |
    b_. x^(a_.)->{b,a}]/.{z_?NumericQ}->{z,0}]


{{5,-3,2,1,-1},{0,-5.2,1,3.2,5}}

Cheers,

Brian


  • Prev by Date: Re: colored alphabet for string output
  • Next by Date: Re: Tree and Lists
  • Previous by thread: Re: Extracting Coefficients and Powers
  • Next by thread: Re: Extracting Coefficients and Powers