Write a function that accepts temperature in degrees Fahrenh

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^2

Solution

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

 Write a function that accepts temperature in degrees Fahrenheit (degree F) and computes the corresponding value in degree Celsius (degree C). The relation betw

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site