MATLAB: Error: The input character is not valid in MATLAB statements or expressions.

matlab r2012bthe input character is not valid

Hi, i have an error when i try to run this
t=-2:.1:5;
x=3*exp(0.4*t);
y=2*exp(-0.9*t);
plot(t,x,t,y,':');
legend('x(t)','y(t)')
i'm new to matlab, please help ASAP 🙁 ps : i'm using matlab r2012b

Best Answer

The error message seems to tell, that the equal character "=" is not valid. How strange. Perhaps it is the space behind the =, which is a backspace charcter '\b' ?!
The code looks okay. How did you insert it to the command window? Simply try to type it again.
What is in the line above? Perhaps a continuation '...' and you've added the ">>" manually? I admit, this is wild guessing.