0
|
17070 Views
|
3 Replies
|
2 Total Likes
View groups...
Share
GROUPS:

# Solve Function: How can I remove x-> from the output?

Posted 9 years ago
 Using the Solve function to find Temperature of a system, I receive an output of T -> x How can I remove the T -> from the output so I can use the number in a graph (or whatever)? Example of code: For[i = 1, i < 18, i++, AppendTo[intTemp, Solve[tungParabola == (vcData[[1, i, 1]]/vcData[[1, i, 2]])/w150] [] ] ] 
3 Replies
Sort By:
Posted 4 years ago
 hello, i am attaching a file. I am getting this solution for my problem. again i want this values as an input to next stage of programming. so i want to replace '==' sign by equal sign. How can i do this ? Attachments:
Posted 9 years ago
 Excellent! That solved my problem.Thank you!
Posted 9 years ago
 Solve is giving you a Rule for T, which is much more polite than setting the variable T to some value. You can use the Rule by a Replace, for which the shortcut is /. (PS. It's a good idea to begin user symbols with lower case, so they don't override Mathematica definitions. ) In:= solution = Solve[3 x + 5 == 2, x] Out= {{x -> -1}} In:= solutionForX = x /. solution Out= {-1} In:= (* You get the nested list because Solve has the possibility \ of offering multiple solutions. You can de-nest like this *) solutionForX = x /. solution[] Out= -1 In:= (* this has set the value for solutionForX *) In:= solutionForX Out= -1 In:= (* you could have set a value for x, but that can be annoying \ if you later want to use it without definition, asn in In *) x = x /. solution[] Out= -1 In:= x Out= -1