I would have thought that the following code would let each indexed variable take its value from the SetterBar
. Instead, all the SetterBar
s take the same value, as the image illustrates. Essentially all the SetterBar
s set the value of var[j]
instead of each setting the value of variables var[1]
, var[2]
, etc. How can I get Mathematica to evaluate the indices when assigning values using the SetterBar
s inside the Table
?
TableForm[
Table[{"Variable " <> ToString[var[j]],
SetterBar[
Dynamic@var[j], {0 -> "negative", 1 -> "positive",
2 -> "ignore"}]}, {j, 5}]]