MATLAB: Plotting a function error

functiongraphingplots

I'm trying to plot the following: y=((e^(-6t))/6)*(1-9e^(6t)+14e^(6t)
t=-10:1:10;
plot (t,((exp(-6*t))/6)*(1-9*exp(4*t)+14*exp(6*t)))
but the error message "inner matrix dimensions must agree" pops up. What a I doing wrong?

Best Answer

Whever you see that, try using dots before the mathematical operators. In other words, use .* instead of *
t=-10:1:10;
y = (exp(-6*t) / 6) .* (1-9*exp(4*t)+14*exp(6*t))
plot(t, y, 'b*-')