- #1
roam
- 1,271
- 12
I want to solve the following problem using Matlab:
Here's the question regarding an object thrown in the air:
http://img197.imageshack.us/img197/7797/97452743.gif
My code:
It doesn't produce a proper plot, all I can see is a dot. What is the problem with my code?
Here's the question regarding an object thrown in the air:
http://img197.imageshack.us/img197/7797/97452743.gif
My code:
Code:
theta=pi/4; v=10; g=9.81; a=0.1;
nfinal=50000;
for t=1:nfinal
x=((1-exp(-a*t))/a)*v*cos(theta);
y=((1-exp(-a*t))/a)*((g/a)+v*sin(theta))-((g*t)/a);
end
plot(t,y,'+')
It doesn't produce a proper plot, all I can see is a dot. What is the problem with my code?
Last edited by a moderator: