Write a Matlab function called hw10m that computes the maxim
Write a Matlab function called hw10.m that computes the maximum horizontal and vertical distance of a projectile and the total travel time, given the firing angle and initial velocity. Also, accept a third optional parameter that adjusts the gravitational constant (g = 9.8065 m2/s default). The angle input is degrees from horizontal, and velocity is m/s. You may need to consult a physics textbook or a reputable web resource such as https://en.wikipedia.org/wiki/Projectile_motion. Your function must do the following:
Solution
function [x,y,t]=hw10(ang,ivel,g)
t=(2*ivel*sin(ang))/g
y=(ivel*ivel*(1-cos(2*ang)))/(2*g)
x=(ivel*ivel*sin(2*ang))/g
