MathGroup Archive 2013

[Date Index] [Thread Index] [Author Index]

Search the Archive

Help_FOR

  • To: mathgroup at smc.vnet.net
  • Subject: [mg129550] Help_FOR
  • From: Marco Scarnicchia <marco.scarnicchia at gmail.com>
  • Date: Tue, 22 Jan 2013 02:41:06 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net

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



  • Prev by Date: Re: Mathematica and Lisp
  • Next by Date: Deriving Euler-Rodriguez Rotation from the three axis-based rotation matrices
  • Previous by thread: Re: Solid State Disk to boost Mathematica performance
  • Next by thread: Deriving Euler-Rodriguez Rotation from the three axis-based rotation matrices