MATLAB: Plot error

hagai

I am trying to do
t=0:0.001:10;
plot(0.25*exp(-t)*sin(2*t),t)
and it says:
??? Error using ==> mtimes
Inner matrix dimensions must agree.
When I tried to divide by exp(t) instead it gave me crap. any ideas? thanks

Best Answer

t=0:0.001:10;
plot(0.25*exp(-t).*sin(2*t),t)
You want an element by element multiplication so you need the '.' in front of the '*'
Related Question