0

I am really stuck at a simple problem. Maybe, it is not totally a problem. However, I don't understand why.

I am trying to take the dot product of two expressions.

Here is the code:

a = {{Ixx, 0, 0}, {0, Iyy, 0}, {0, 0, Izz}}
b = {{0}, {0}, {Theta1'[t]}} 

a.b should work according to the documentation. I am expecting the result

{{0}, {0}, {Izz*Theta1'[t]}}

and after // MatrixForm, it will be [0; 0; something].

But, after the a.b production, I just get this:

enter image description here

Thanks in advance.

Rohit Namjoshi
  • 10,212
  • 6
  • 16
  • 67
yoeruek
  • 3
  • 2

1 Answers1

3

MatrixForm is wrapper. It prevent future evaluations. You must have added a MatrixForm around a and b before, that is why.

Try

a = {{Ixx, 0, 0}, {0, Iyy, 0}, {0, 0, Izz}}; b = {{0}, {0}, {Theta1'[t]}};
(a.b) // MatrixForm

enter image description here

It looks like you did this before

a = MatrixForm@{{Ixx, 0, 0}, {0, Iyy, 0}, {0, 0, Izz}}; 
b = MatrixForm@{{0}, {0}, {Theta1'[t]}};
(a.b)

enter image description here

To see the matrix using MatrixForm and also not have to worry about it going into it and causing problems later on, just use () like this

(a = {{Ixx, 0, 0}, {0, Iyy, 0}, {0, 0, Izz}}) // MatrixForm
(b = {{0}, {0}, {Theta1'[t]}}) // MatrixForm
(c = a.b) // MatrixForm

enter image description here

Nasser
  • 143,286
  • 11
  • 154
  • 359