((exp(-0.5*t))*((-0.9)*(cos(1.323*t))
The left side of the * operator is the same size as t is.
The right side of the * operator is also the same size as t is.
The * operator is algebraic matrix multiplication, also called "inner product" . For two matrices A*B, the rule is that size(A,2) must be the same as size(B,1) and that the output is size(A,1) by size(B,2) . For example you can * together a 4 x 3 matrix and a 3 x 1 matrix and get a 4 x 1 result.
Consider something the same size as t * something the same size as t. For it to be valid, then the second dimension of the first operand, which is size(t,2), must equal the size of the first dimension of the second operand, which is size(t,1) . So size(t,1) == size(t,1) must be true. That is only true if t is a square matrix.
Chances are that your t is not a square matrix, and is instead a 1 x something vector. 1 x N * 1 x N is not valid matrix multiplication.
If you want to multiply corresponding elements of ((exp(-0.5*t))*((-0.9) and (cos(1.323*t)) then that is referred to as "elementwise multiplication", and as indicated in the error message, that is the .* operator instead of the * operator.
((exp(-0.5*t))*((-0.9).*(cos(1.323*t))
Best Answer