Student Support Forum: 'Noninteger powers' topicStudent Support Forum > General > "Noninteger powers"

 < Previous Comment Help | Reply To Comment | Reply To Topic
 Author Comment/Response yehuda 10/06/12 3:56pm well, you can use pattern matching yourself here is a random "polynomial" with random powers and random coefficients (both are reals, but with different ranges) randPol = Total@Table[RandomReal[{-1, 1}] x^RandomReal[10], {10}] -0.817982 x^0.161275 - 0.850015 x^2.12404 - 0.270541 x^3.18772 - 0.151438 x^3.41432 - 0.949532 x^4.50049 - 0.567231 x^5.59609 - 0.0548254 x^7.34203 + 0.687153 x^7.64846 - 0.165511 x^8.01469 + 0.966595 x^9.11756 Now, use Cases. Note the periods Cases[randPol, coef_. x^pow_. :> {coef, pow}] {{-0.817982, 0.161275}, {-0.850015, 2.12404}, {-0.270541, 3.18772}, {-0.151438, 3.41432}, {-0.949532, 4.50049}, {-0.567231, 5.59609}, {-0.0548254, 7.34203}, {0.687153, 7.64846}, {-0.165511, 8.01469}, {0.966595, 9.11756}} After having the list of results, manipulate it as you wish yehuda URL: ,

 Subject (listing for 'Noninteger powers') Author Date Posted Noninteger powers Paolo 10/05/12 2:52pm Re: Noninteger powers yehuda 10/06/12 3:56pm
 < Previous Comment Help | Reply To Comment | Reply To Topic