- #1
Saladsamurai
- 3,020
- 7
Hi All!
I am trying to get used to Mathematica and rules and all things syntax. What I am trying t do is this:
If I define a variable as such
The output is:
So I believe what this means is that the variable m now conatins a list of rules for x.
Now if I use the command:
the output is:
which is again a rule. But what if I want, t, to actually take on the value of that solution. That is, I want:
What syntax or command do I need to use to extract this from m?
Thanks!
I am trying to get used to Mathematica and rules and all things syntax. What I am trying t do is this:
If I define a variable as such
Code:
m = Solve[x^4 - 4 == 0, x]
The output is:
Code:
{{x -> -Sqrt[2]}, {x -> -I Sqrt[2]}, {x -> I Sqrt[2]}, {x -> Sqrt[2]}}
So I believe what this means is that the variable m now conatins a list of rules for x.
Now if I use the command:
Code:
t = m[[2]]
the output is:
Code:
{x -> -I Sqrt[2]}
which is again a rule. But what if I want, t, to actually take on the value of that solution. That is, I want:
Code:
t [B]=[/B] -I Sqrt[2]
What syntax or command do I need to use to extract this from m?
Thanks!