MATLAB: Not enough input arguments graphing exp

exp; input; not; enough; graphing; plot

Very new to matlab, second time ever working with it!
have to plot a graph with multiple lines involving exponentials. Code so far:
t = 0:7;
y1 = (-5*exp(-t) + 20*exp(-2*t) – 15*exp(-3*t));
y2 = (2*exp(-2*t) – exp*(-1*t));
figure
plot (t,y1,t,y2)
Not sure if I should use linspace for first line also…
I get an error: not enough input for exp, and I am curious as to what that means??
Once again, I am not too familiar with matlab. I have looked through all of the help and definitions, and have tried various notations and forms, but I am just stuck. Any help or suggestions would be very appreciated!

Best Answer

Typo!
y2 = (2*exp(-2*t) - exp*(-1*t));
^
Remove the extra ‘*’ and you’re good to go.
And definitely go with linspace. You’ll get a much better looking plot.
Changing the ‘t’ assignment to:
t = linspace(0,7);
will work fine.