Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Help_FOR
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
marco.scarnicchia@gmail.com

Posts: 3
Registered: 12/11/12
Help_FOR
Posted: Jan 22, 2013 2:40 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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]];
TabDH[[1]][[1]] = {PopupMenu[
Dynamic[Subscript[\[Theta], 1]], {0, Subscript[q,
1], -2 Pi, -3 Pi/2, -Pi, -Pi/2, Pi/2, Pi, 3 Pi/2, 2 Pi}],
PopupMenu [
Dynamic[Subscript[d, 1]], {0, Subscript[l, 1], Subscript[q, 1]}],
PopupMenu [
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]}]}
TabDH[[1]][[2]] = {PopupMenu[
Dynamic[Subscript[\[Theta], 2]], {0, Subscript[q,
2], -2 Pi, -3 Pi/2, -Pi, -Pi/2, Pi/2, Pi, 3 Pi/2, 2 Pi}],
PopupMenu [
Dynamic[Subscript[d, 2]], {0, Subscript[l, 2], Subscript[q, 2]}],
PopupMenu [
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]];
TabDH[[1]][[i]] = {PopupMenu[
Dynamic[Subscript[\[Theta], i]], {0, Subscript[q,
i], -2 Pi, -3 Pi/2, -Pi, -Pi/2, Pi/2, Pi, 3 Pi/2, 2 Pi}],
PopupMenu [
Dynamic[Subscript[d, i]], {0, Subscript[l, i], Subscript[q, i]}],
PopupMenu [
Dynamic[Subscript[\[Alpha], i]], {0, -2 Pi, -3 Pi/2, -Pi, -Pi/2,
Pi/2, Pi, 3 Pi/2, 2 Pi}],
PopupMenu [Dynamic[Subscript[a, i]], {0, Subscript[h, i]}]};
]

Thanks




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.