How Can Mathematica Extract and Reuse Output Values for Further Computations?

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 4K views
Orion1
Messages
961
Reaction score
3

[tex]\text{In}[1]:=\text{Solve}\left[\partial _{\theta } \text{Sin}[\theta ]==0,\theta \right][/tex]

[tex]\text{Out}[1]:=\left\{\left\{\theta \to -\frac{\pi }{2}\right\},\left\{\theta \to \frac{\pi }{2}\right\}\right\}[/tex]

Is there a Mathematica source code command that can read a specific numerical value from the output box data?

[tex]y_1[\text{x$\_$}]\text{:=}x^2[/tex]
[tex]y_2[\text{x$\_$}]\text{:=}\partial_x x^2[/tex]
[tex]\text{Plot}\left[y_1[x],\{x,0,1\}\right][/tex]
[tex]\text{Plot}\left[y_2[x],\{x,0,1\}\right][/tex]
[/Color]
ivar: ... is not a valid variable.
[/Color]
Is there a symbolic source code solution that will alloy me to define and plot a recently differentiated function?

I can plot the function by manually copying the output box data in immediate mode and pasting it back into the function definition.
[/Color]
 
Last edited:
Physics news on Phys.org
Orion1 said:
[tex]y_2[\text{x$\_$}]\text{:=}\partial_x x^2[/tex]
...
Is there a symbolic source code solution that will alloy me to define and plot a recently differentiated function?
Try:
[tex]y_2[\text{x$\_$}]\text{:=Evaluate[}\partial_x x^2\text{]}[/tex]