Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Help_FOR
Replies: 0

 marco.scarnicchia@gmail.com Posts: 3 Registered: 12/11/12
Help_FOR
Posted: Jan 22, 2013 2:40 AM

Hi,
I have a problem with this code:

Exit[]
Nrighe = 2;
Parameters = {Subscript[\[Theta], i], Subscript[d, i],
Subscript[\[Alpha], i], Subscript[a, i]};
TabDH = Grid[Table[Parameters, {i, Nrighe}], Frame -> All]
Riga[1] = TabDH[[1]][[1]];
Riga[2] = TabDH[[1]][[2]];
Dynamic[Subscript[\[Theta], 1]], {0, Subscript[q,
1], -2 Pi, -3 Pi/2, -Pi, -Pi/2, Pi/2, Pi, 3 Pi/2, 2 Pi}],
Dynamic[Subscript[d, 1]], {0, Subscript[l, 1], Subscript[q, 1]}],
Dynamic[Subscript[\[Alpha], 1]], {0, -2 Pi, -3 Pi/2, -Pi, -Pi/2,
Pi/2, Pi, 3 Pi/2, 2 Pi}],
PopupMenu [Dynamic[Subscript[a, 1]], {0, Subscript[h, 1]}]}
Dynamic[Subscript[\[Theta], 2]], {0, Subscript[q,
2], -2 Pi, -3 Pi/2, -Pi, -Pi/2, Pi/2, Pi, 3 Pi/2, 2 Pi}],
Dynamic[Subscript[d, 2]], {0, Subscript[l, 2], Subscript[q, 2]}],
Dynamic[Subscript[\[Alpha], 2]], {0, -2 Pi, -3 Pi/2, -Pi, -Pi/2,
Pi/2, Pi, 3 Pi/2, 2 Pi}],
PopupMenu [Dynamic[Subscript[a, 2]], {0, Subscript[h, 2]}]}

I would like to simplify using a for loop but I can not. Someone could you help me out?

For[i = 1, i <= Length[Nrighe], i++,
Riga[i] = TabDH[[1]][[i]];
Dynamic[Subscript[\[Theta], i]], {0, Subscript[q,
i], -2 Pi, -3 Pi/2, -Pi, -Pi/2, Pi/2, Pi, 3 Pi/2, 2 Pi}],
Dynamic[Subscript[d, i]], {0, Subscript[l, i], Subscript[q, i]}],