Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: Using the slider values in a Manipulate

  • To: mathgroup at smc.vnet.net
  • Subject: [mg99010] Re: [mg98931] Using the slider values in a Manipulate
  • From: John Fultz <jfultz at wolfram.com>
  • Date: Fri, 24 Apr 2009 03:44:58 -0400 (EDT)
  • Reply-to: jfultz at wolfram.com

On Wed, 22 Apr 2009 05:10:41 -0400 (EDT), hmalissa wrote:
> How can I use the values adjusted with the sliders in a Manipulate
> later in the notebook?
> The only way seems to be the DynamicModule, but that's not exactly
> what I want.
> To be more specific: I'm trying to write a notebook for fitting a
> model function to experimental data, and I want it to be reusable
> since I'll have to use it on different data files again and again.
> I want to plot the data and the model inside a Manipulate, and use the
> sliders to adjust reasonable startig values for my parameters. That
> does work very well, but the next step would be to insert these
> starting values (from the slider adjustments) as starting values in
> FindFit. How do I achieve this? I don't understand how I could use
> DynamicModule to do this, but what other options do I have.


One very simple way of doing this is to pass the option
LocalizeVariables->False to the Manipulate[] command.  This option
indicates to Manipulate that the variables associated with the various
controls should be global variables rather than variables scoped in
a DynamicModule[].

Of course, if you do this, you'll want to make sure not to choose names
that are too generic and likely to be accidentally used elsewhere in
your code.

Sincerely,
 
John Fultz
jfultz at wolfram.com
User Interface Group
Wolfram Research, Inc.




  • Prev by Date: Re: Re: pure function with optional number of arguments
  • Next by Date: Mathematica JLink and comm.javax.CommPortIdentifier
  • Previous by thread: Re: Using the slider values in a Manipulate
  • Next by thread: Remote Kernel Connection Error