MATLAB: Plot always appears as a straight line

plot

v = [0:100];
m = 4.65*10.^-26;
y = ((m*v)/(4.14*10.^-21)).*exp((-m*v.^2)/2*4.14*10.^-21);
plot(v,y)
title('Density fucntion at t1 and t2')
Hi, I don't know how to fix this but my graph appears to be a straight line intead of an exponential curve. Thanks a lot!

Best Answer

Are you sure the second "4.14*10.^-21" doesn't belong in the denominator:
y = ((m*v)/(4.14*10.^-21)).*exp((-m*v.^2)/(2*4.14*10.^-21));
If so, and if you change the range of v to:
v = [0:1000];
you will get a nicely curved plot.
Related Question