MathGroup Archive 2004

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

Search the Archive

Re: Extracting Coefficients and Powers


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