MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Very very basic question about Mathematica expressions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg111123] Re: Very very basic question about Mathematica expressions
  • From: Themis Matsoukas <tmatsoukas at me.com>
  • Date: Wed, 21 Jul 2010 07:12:14 -0400 (EDT)

The control variable (h) is internal to Manipulate but you can link it to an external variable. The following works:

s := x + h;
Manipulate[Plot[s /. h -> H, {x, 0, H}], {H, 0.1, 1}]

Notice the := in the definition of s. If you replace it with =,  the above will still work but only as long as h has not been assigned a numerical value. However, if you do assign a numerical value, say h=3, the graph will plot x+3, regardless of the value you pick for H. For this reason it is a good idea to use the delayed assignment (:=) rather than the regular =. 

Themis


  • Prev by Date: Re: Kolmogorov-Smirnov 2-sample test
  • Next by Date: Re: Very very basic question about Mathematica expressions
  • Previous by thread: Very very basic question about Mathematica expressions
  • Next by thread: Re: Very very basic question about Mathematica expressions