Message Boards Message Boards

0
|
3915 Views
|
7 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Saving list of controls values in Manipulate[ ]?

Posted 2 years ago

How can I save a certain configuration in a manipulate script (with some slider values and some checkboxes and tabs f.i.), so i can later reload these settings again into the Manipulate (script or object)?

If that is not possible, which would surprise me, how can I save the values of the Sliders etc. into a List? I know of Snapshot : but I do not need the complete Manipulate script every time, I need just the values of the controls.

Thanks.

POSTED BY: B. Cornas
7 Replies
Posted 2 years ago

Great, Thanks :-)

POSTED BY: B. Cornas
Posted 2 years ago

Thanks Hendrik, this works with Manipulate.

But in a script with Dynamic sliders (not Manipulate), I do not find the correct place to put the "LocalizeVariables -> False". Every spot in the script gives me the RED warning that the syntax is wrong. Any ideas how to get the Dynamic variables in a script with Dynamic controls (but not in a not Manipulate)?

POSTED BY: B. Cornas
Posted 2 years ago

You may have to provide an example of the code to explain the problem in more detail. Based on your earlier clarification, this seems to do what you want.

ClearAll[x, y];
Column[{Slider[Dynamic[x]], Slider[Dynamic[y]]}]

Move the sliders then evaluate

{x, y}
POSTED BY: Rohit Namjoshi

What you are looking for is probably the option LocalizeVariables -> False; e.g. try:

Manipulate[Plot[Sin[x (a + b x)], {x, 0, 6}], {a, 0, 2}, {b, 0, 2}, 
 LocalizeVariables -> False]

after this the variables a and b have the respective values.

POSTED BY: Henrik Schachner
Posted 2 years ago

Let me try again, but a bit different :-)

I have a couple of Dynamic Controls (Sliders) , which I manipulate untill I have a graphic that suits me.

  1. How can I get the actual values of the Dynamic Sliders (the values I am happy with) into a List?

  2. The same for Dynamic Checkboxes, Menus, etc.

POSTED BY: B. Cornas
Posted 2 years ago

Thanks for your reply, but it is not exactly what I am after. I just want a List of the Values of the Controllers.

POSTED BY: B. Cornas

Saving the notebook and reopening it should give the last used values. Paste snapshot should give a DynamicModule with the list of current control values. I don't know of a direct, easy way to reload them, though.

POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract