`Hey,
Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries
FUNCTION FILE
function t=fun(v0,h)
g=9.81;
f=@(t) v0*t-0.5*g*t.^2-h;
t=fzero(f,10);
end
Command needed to run
fun(50,100)
b)
clear
all
clc
x=input('Enter x: ');
if(x<-1)
y=exp(-x+1);
elseif(x<5)
y=2*sin(pi*x);
else
y=10*(x-5)+1;
end
fprintf('The value is %f\n',y);

Kindly revert for any queries
Thanks.
2. (aj An object thrown vertically with a speed vo reaches a height h at time t,where with a user defined function that computes the time required to reach a Write a MATLAB program specified heig...
2. (a) An object thrown vertically with a speed vo reaches a height h at time t, where: he vot tgt Write a MATLAB program with a user defined function that computes the time required to reach a specified height h, for a given value of vo. The function's input should be h, Vo, and g. Test your function for the case where h 100 m, Vo-50 m/s and g9,81 m/s2 by free hand. Write the MATLAB command how you...
The height of a ball thrown vertically upward from a rooftop is modelled by y=-5t^2+20t+50 , where h(t) is the ball's height above the ground , in meters , at time t seconds after the throwa) Determine the max height of the ballb) how long does it take for the ball to reach its max heightc) How high is the rooftop