I want to extract coefficients and powers of the expression
$$3-2x+7x^{2.1}+x^{2.4}-5x^3$$
Code:
expr = 3 - 2 x + 7 x^2.1 + x^2.4 - 5 x^3;
To get a result such as:
{{0,3},{1,-2},{2.1,7},{2.4,1},{3,-5}}
I tried to use Coefficient
but that didn't work.
In[54]:= expr = 3 - 2 x + 7 x^2.1 + x^2.4 - 5 x^3; Map[{# /. x -> 1, Exponent[#, x]} &, Collect[Rationalize@expr, x, Plus, List]] Out[55]= {{3, 0}, {-2, 1}, {7, 21/10}, {1, 12/5}, {-5, 3}}
$\endgroup$