I want to plot x(t)=t*exp(-3*t)+0.25*exp(-3*t), and its first and second time derivatives.
I cannot even get the first plot correct. This is what I have done.
t = [0:0.01:3];
x = t*exp(-3*t)+0.25*exp(-3*t);
figure
plot(t,x);
From what I understand, that is saying that t goes from 0 to 3 in steps of 0.01 and x is the function I defined at that t. MatLab gives me this error
"Error using * Inner matrix dimensions must agree."
Can someone please let me know what's going on? I'm a matlab noob. I use mathematica quite a bit and I have used octave for making plots of data, but never to plot functions. I always do that stuff with mathematica!
you have to have
this will do element by element multiplication
.*is the element by element multiplication for a vector,*is just multiplication.