Message Boards Message Boards

Use a push button to set Manipulate variables to specific values?

I need a push bottom instead of a check bottom that will allow me to set the manipulate variables to specific values. In th ecode below, need bottom t1 that will set .

    ClearAll["Global`*"]
    Manipulate[
     DensityPlot3D[
      z + y + Sec[x - Pi/6], {x, -2 - Pi*f1, 2 Pi}, {y, -2 - Pi*f2, 
       2 Pi}, {z, -2 - Pi*f3, 2 Pi}],
     {{f1, If[t1, 2.5, 1.5]}, 0, 10},
     {{f2, 1.5}, 0, 10},
     {{f3, 1.5}, 0, 10},
     {t1, {True, False}}
]
POSTED BY: Jose Calderon

An attempt:

Manipulate[
 DensityPlot3D[
  z + y + Sec[x - Pi/6], {x, -2 - Pi*f1, 2 Pi}, {y, -2 - Pi*f2, 
   2 Pi}, {z, -2 - Pi*f3, 2 Pi}],
 {{f1, 1.5}, 0, 10},
 {{f2, 1.5}, 0, 10},
 {{f3, 1.5}, 0, 10},
 Item[Button["set f1 = 2.5", f1 = 2.5]]]
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