It is not a big problem and I will tell you what your problem is and then you can write the code yourself then.
Let me tell you how plot works in Matlab. For example If you want to plot for Y=t*exp(3*t), you will do the following.
So basically * means matrix multiplication in matlab and here it does (1*11) by (1*11) which is not possible. What you actually want is the first element of t to be multiplied by first element of exp(3*t) which is (0*0) and second element by second element and so on,This is called Element-wise-Multiplication.
t= 0 1 2 3 4 5 6 7 8 9 10
exp3*t= 0 0 0 0 0 0 0.0001 0.0026 0.0532 1.0686
Now if you multiply by using (.*) command, you will end up in (1*11) vector again which will be stored in y.
So you can plot now using plot command.
Whenever you errors like this,you can use size command. Here size(t) gives you the answer 1 11 which means 1 row and 11 column, Likewise if you enter size(exp(3*t)), again it will give you 1 11 and it will give you an intuitive sense why it is not multiplying.
Best Answer