From: Patrick on
Hi,

I am currently working on a matlab homework assignment for my Civil Engineering course at MSU. Using information such as:

Vo = 100;
angle = pi/4;
t = 0:.1:20;
and g = 9.8

and the calculations of:

h= t*Vo*cos(angle)
v= t*Vo*sin(angle) - 1/2*g*t.^2

Creat a user defined function called projectileMotion that takes as arguments Initial Velocity (Vo), Initial angle (Beta), Time step (DeltaT), and line type (lt).

Include a line that calculates the time in which the projectile hits the ground (vertical (tmax)= 0) then use this as the maximum time limit in your solution. That is, make t = 0: delta T: Tmax.

Basically i have used matlab for simple calculations such as matrixes and laws of cosines and sines, but i don't quit understand how to start such a problem as this. any suggestions?
From: Mark Shore on
"Patrick " <ricecake001(a)msn.com> wrote in message <hq0hvn$gih$1(a)fred.mathworks.com>...
> Hi,
>
> I am currently working on a matlab homework assignment for my Civil Engineering course at MSU. Using information such as:
>
> Vo = 100;
> angle = pi/4;
> t = 0:.1:20;
> and g = 9.8
>
> and the calculations of:
>
> h= t*Vo*cos(angle)
> v= t*Vo*sin(angle) - 1/2*g*t.^2
>
> Creat a user defined function called projectileMotion that takes as arguments Initial Velocity (Vo), Initial angle (Beta), Time step (DeltaT), and line type (lt).
>
> Include a line that calculates the time in which the projectile hits the ground (vertical (tmax)= 0) then use this as the maximum time limit in your solution. That is, make t = 0: delta T: Tmax.
>
> Basically i have used matlab for simple calculations such as matrixes and laws of cosines and sines, but i don't quit understand how to start such a problem as this. any suggestions?

Copy the code you've shown above into the command window or a blank M-file and run it. Plot h and v versus t, and v vs h (e.g. plot(h,v,'bo-')). Look at the results. Understand them.

Then type <doc function> from the command line (excluding the brackets) and figure it out from there.