Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'How to get useable values from curly brackets?' topicStudent Support Forum > General > Archives > "How to get useable values from curly brackets?"

Next Comment >Help | Reply To Topic
Author Comment/Response
Chuck Saunders
02/09/13 3:10pm

I have a FindRoot function that returns an angle theta. However, it doesn't return just the value, it returns something that looks like:
{theta0 -> 1.49823}

This is fine if I want to manually copy/paste the 1.498.. from the output, but I don't. The output is correct, but I want to be able to assign the output to a variable, like:

theta_solved = FindRoot[ stuff ]

And have theta_solved = 1.498. Right now, that equation just has theta_solved equal to the curly bracketed values, and I can't use that in any other equations.

How do I get the 1.49823 out of the brackets? I've seen theta_solved[[1]], and that gives

theta0 -> 1.49823

which is equally not useable, and Flatten[theta_solved] doesn't do anything.

URL: ,

Subject (listing for 'How to get useable values from curly brackets?')
Author Date Posted
How to get useable values from curly brackets? Chuck Saunders 02/09/13 3:10pm
Re: How to get useable values from curly bracke... Bill Simpson 02/09/13 5:41pm
Re: How to get useable values from curly bracke... Bill 02/10/13 12:58pm
Next Comment >Help | Reply To Topic