Look at the first part of a line of code inprojectmatrix.m:
dx(2) = ((k1 - k2)/m1)*u1
On the left side, you have a scalar. On the right, you have a vectoru1 of length 2. Another term in this line is(c/m1)*u1(2), so perhaps you mean to write
dx(2) = ((k1 - k2)/m1)*u1(1)
Note that there are several more uses ofu1,u2 andu3 that have the same problem.
Best Answer