Assume that I am in Mathematica trying to use the Function Solve and the output is $\{r \rightarrow 2, r\rightarrow 3 , r\rightarrow 4\}$, and from this I want to pick the solution $r=4$ So I have tried using the command $[[3]]$ but what I get is $r\rightarrow 4$. Is there anyway I can something else to only get $4$?
Thanks in advance.
Values[rules]gives a list of the right-hand sides of the->. – Michael E2 Aug 08 '20 at 17:27sol. Thenr /. sol[[3]]. But you should read the link provided in the previous comment. – PaulCommentary Aug 08 '20 at 17:30ras a variable,r=4is not so nice, as it defines avaluethat automatically replacesrwith4whenever it appears. But having aRuleliker->4is more useful, because now you have control over your replacement. Thus, an expression like2r/.r->4yields8without getting in the way of continuing to useras a variable. – John Doty Aug 08 '20 at 18:24List@@@{r->1, r->3,r->4}[[3,2]], maybe? – user1066 Aug 08 '20 at 19:46