The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Manipulate and Initialization
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Simons, F.H.

Posts: 107
Registered: 12/7/04
Manipulate and Initialization
Posted: Mar 23, 2013 3:24 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I want to create a rather complicated Manipulate, in which I do not know
the limits for the parameter beforehand; they depend on the result of an
initialization. Here is a highly simplfied example:

Manipulate[n, {n,1,nn,1},

This works fine. The slider can be used in the range from 1 to the
printed value.

However, when nn already has a value, the behaviour is different. When
we execute

Manipulate[n, {n,1,nn,1},

a value between 5 and 15 for nn is printed, but that value is not used
in the result; the slider now runs from 1 to 23.

So, whether nn has a value or not, just before the box structure is
printed, the frontend asks the kernel to evaluate the initialization.
But the returned value of nn is used in Manipulate only when nn did not
have a value before. That embarasses me. Any explanation is highly

Fred Simons
Eindhoven University of Technology

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.