You have something of generally the form exp(t) * cos(t) . That * operation is algebraic matrix multiplication, which can only work if the second dimension of the first argument (so, length(t) in this case) is the same as the first dimension of the second argument (which would be 1 in this case, since cos(t) would be a 1 x something vector.)
You should probably be using .* operator instead of the * operator.
