Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Simple Manipulate and Plot Problem' topicStudent Support Forum > General > Archives > "Simple Manipulate and Plot Problem"

< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic
Author Comment/Response
Forum Moderator
email me
05/13/13 11:52am

Short answer: the use of "rule" is buried in two levels of argument Hold-ing, by Manipulate and by Plot.

These work:

rule = {z -> x^2 + 2*x + y};

With[{rule = rule},
Manipulate[Plot[z /. rule, {x, 0, 10}], {{y, 2, "y"}, 1, 5}]]

(Change all uses of "rule" inside the expression to have the definition of the global "rule". See reference.wolfram.com/mathematica/ref/With.html, under Scope.)


Manipulate[
Block[{y = yy}, Plot[z /. rule, {x, 0, 10}]], {{yy, 2, "y"}, 1, 5}]

(Changes the environment Plot works in so a y appearing inside it gets the local value from Block.)



URL: ,

Subject (listing for 'Simple Manipulate and Plot Problem')
Author Date Posted
Simple Manipulate and Plot Problem Jaleno 05/12/13 06:33am
Re: Simple Manipulate and Plot Problem jf 05/12/13 4:56pm
Re: Simple Manipulate and Plot Problem Forum Modera... 05/13/13 11:52am
Re: Re: Simple Manipulate and Plot Problem Jaleno 05/13/13 5:27pm
< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic