Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

how uncouple dynamic objects?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg109430] how uncouple dynamic objects?
  • From: Murray Eisenberg <murray at math.umass.edu>
  • Date: Tue, 27 Apr 2010 04:04:54 -0400 (EDT)
  • Organization: Mathematics & Statistics, Univ. of Mass./Amherst
  • Reply-to: murray at math.umass.edu

Here's a simple example of a more complicated situation where I define a
function that takes a function as argument and uses Manipulate to
produce its output:

   fplot[f_]:= Manipulate[
                 Plot[f[x+a],{x,-2,2}],
               {a,0,2}]
   f[x_]:= x^2
   fplot[f]

   f[x_]:=x^3
   fplot[f]

When I execute the second definition (with x^3) of f, it automatically
changes the f used in the still-displayed output from the first call to 
fplot.

How can I isolate the two instances -- and yet still use the same name
for the two different functions?  (Or is this not possible?)

Clearly this is an issue of the dynamic structure underlying
Manipulate, and I'm willing to use a "direct" definition using a
Dynmaic variable a with a control instead of the simpler
Manipulate. But of course I'd prefer to be able to do it with
Manipulate.

-- 
Murray Eisenberg                     murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305


  • Prev by Date: Re: Database memory usage
  • Next by Date: Re: Database memory usage
  • Previous by thread: Re: BinCounts to InterpolatingFunction
  • Next by thread: Re: how uncouple dynamic objects?