Write a function that accepts temperature in degrees Fahrenheit (degree F) and c
ID: 3420739 • Letter: W
Question
Write a function that accepts temperature in degrees Fahrenheit (degree F) and computes the corresponding value in degree Celsius (degree C). The relation between the two is T degree C = 5/9 (T degree F-32) Be sure to test your function. An object is thrown vertically with a speed v_0 reaches a height h at time t, where h=v_0 t-1/2 gt^2 Write a MATLAB program that computes the time t required to reach a specified height h, for a given value of v_0. The inputs should be h, v_0, and g. Test your function for the case where h=100 meters, v_0 = 50 m/s and g=9.81 m/s^2Explanation / Answer
function y = FtoC(x)
y=(5/9)*(x-32)
end
______________________________________________________________
function t= time(h,v0,g)
t1=(v0/g)+sqrt(v0*v0-2*g*h)/g;
t2=(v0/g)-sqrt(v0*v0-2*g*h)/g;
if(t1>=0)
t=t1;
else if(t2>=0)
t=t2;
else
print(no answer);
end
end
end
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.