I have a DynamicModule
with several graphic elements. I would like to create a button which would change a parameter and re-run the entire module.
Say that we have
h := Plot[Sin[k*x], {x, 0, 10}]
with an initial value of k = 1
.
I want to create Button["Increase k", k = k + 1; h]
that would run the plot (without using Print[h]
as h
is really a large DynamicModule
).
Manipulate
is used. As sample add one more parameter(g) to itManipulate[Plot[Sin[k*x + g], {x, 0, 10}], {k, 1, 10}, {g, 1, 10}]
controls for k ,g are created automatically. $\endgroup$ – Sejwal Jul 14 '13 at 12:17Dynamic
. AddDynamic
only tok
wherever it is (pay attention to Heads) or in case ofManipulate
include only thatButton
and maybe appendTrackedSymbols:>{ k, ...}
. $\endgroup$ – Kuba♦ Jul 14 '13 at 14:08