Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Possible Duplicate:
Assign the results from a Solve to variable(s)

I want to assign the results of a Solve command in a list. For example Solve[-((287 s^3)/50) == 0, s] returns {{s -> 0}, {s -> 0}, {s -> 0}} I want it to return {0,0,0}. Can this be done automatically and not manually? Thank you very much

share|improve this question

marked as duplicate by Sjoerd C. de Vries, Jens, Artes, Oleksandr R., rm -rf Nov 17 '12 at 22:18

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Lookup Part in the docs. –  b.gatessucks Nov 17 '12 at 15:53
I'm sure this is a duplicate... perhaps not exact, but maybe: mathematica.stackexchange.com/q/6669/121 –  Mr.Wizard Nov 17 '12 at 16:26
Here is another related question : mathematica.stackexchange.com/questions/14185/… –  Artes Nov 17 '12 at 17:05

1 Answer 1

You can use

s = Solve[-((287 s^3)/50) == 0, s][[All,1,2]]

To get

s = {0,0,0}
share|improve this answer
...or s /. Solve[-((287 s^3)/50) == 0, s] –  J. M. Nov 17 '12 at 15:57
Solve[-((287 s^3)/50) == 0, s][[All, 1, 2]] more than Solve[-((287 s^3)/50) == 0, s][[All,2]] –  Öskå Nov 17 '12 at 15:58
You are rigth. Corrected –  Murta Nov 17 '12 at 16:00
Ok thank you very much, you are very quick with your answers and helpful. I have been trying to find it for some time but couldn't, now i'll go check out more details in the documents about 'part'. Thanks a lot –  Lazaros Moysis Nov 17 '12 at 16:02

Not the answer you're looking for? Browse other questions tagged or ask your own question.