Hi,
1) radians or degrees:
sin(), cos(), etc. use arguments in radians.
sind(), cosd(), etc. use arguments in degrees.
So you have to correct your code.
2) For converting angles from degrees in radians and vece versa:
angle_in_radians = angle_in_degrees * pi/180;
angle_in_degrees = angle_in_radians * 180/pi;
3) I recommend to put this line at the beginning:
thetaD = 45;
ant then use thetaD instead of a particular value.
4) In the line
Vt=time.*Vo*sin(45)-(1/2)*g.*t^2;
what is t? It should be like this:
Vt=time.*Vo*sind(thetaD)-(1/2)*g*time.^2;
Regards
Z