In this example, I want a series of four buttons to change the value of a variable that is used dynamically to drive a plot. I am trying to figure out why using Table around the buttons causes a problem.
This works:
{Button["1", freq = 1], Button["2", freq = 2], Button["3", freq = 3],
Button["4", freq = 4]}
Dynamic[Plot[Sin[freq * x], {x, 0, 2 \[Pi]}]]
Why doesn't this work:
Table[Button[ToString[i], freq2 = i], {i, 4}]
Dynamic[Plot[Sin[freq2 * x], {x, 0, 2 \[Pi]}]]