MATLAB: Matrix dimensions incompatible problem.

MATLABmatrix

Hey, basic new guy question here, that I feel stupid even asking but I can't seem to find the answer or get my code to work. All I'm trying to do is define a time domain and then have matlab return an x value for each time increment in the time domain, according to a given formula:
t=linspace(0,3);
dampedx =(0.1*cos(10*t)+0.00025*sin(10*t))*exp(-0.0025*t);
The trig function part works, but it is the "exp(-0.0025*t)" term it seems to have an issue with. I tried using "t." instead of "t" because I'm trying to tell it for each value of t, calculate a corresponding value of x, but I think it is trying to do something funky with the entire array of values in t, because it keeps giving me some error about matrix dimensions.

Best Answer

Use .* instead of *