0

Possible Duplicate:
Question about MapThread and Dynamic

I'm trying to extract element of a matrix. Let's suppose that the matrix is

ACC = {{1, 0, 0, 1}, {0, 0, 0, 2}, {0, 0, 0, 3}, {0, 0, 0, 1}}

then

ACC[[1,4]]

will return 3. I don't understand why Mathematica is giving me the error Part::partw when trying to get the value [[1,x]] with x>1 of the following matrix Rbar: (sorry for the code but it wont work otherwise)

Avz[\[Theta]z_, 
   dz_] := {{Cos[\[Theta]z], -Sin[\[Theta]z], 0, 0}, {Sin[\[Theta]z], 
    Cos[\[Theta]z], 0, 0}, {0, 0, 1, dz}, {0, 0, 0, 1}};

Avx[\[Theta]x_, 
   dx_] := {{1, 0, 0, dx}, {0, Cos[\[Theta]x], -Sin[\[Theta]x], 
    0}, {0, Sin[\[Theta]x], Cos[\[Theta]x], 0}, {0, 0, 0, 1}};

Linea[tz_, dz_, tx_, dx_] := Avz[tz, dz].Avx[tx, dx];

Grid[{{"", "Theta", "d", "Alpha", "a"}, {"Link1", 
   InputField[Dynamic[t1], FieldSize -> 3], 
   InputField[Dynamic[d1], FieldSize -> 2], 
   InputField[Dynamic[alpha1], FieldSize -> 4], 
   InputField[Dynamic[x1], FieldSize -> 1]}}, 
 Frame -> Darker[Gray, .6], Alignment -> {{Left, {Center}}}]


Rt = {{1, 0, 0, -L1/2}, {0, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}};

Rbar = Dynamic[Linea[t1, d1, alpha1, x1].Rt]

here Rbar[[1,4]] for example returns error, but why?

UserK
  • 133
  • 5

0 Answers0