In: Computer Science
Write MATLAB script programs to perform the following conversions, taking a value in SI units as the input argument and returning the value to US Customary Units.
a. Length: Centimeters to inches
b. Temperature: °C to °F
c. Force: Newton to Pound-force
d. Speed: Meters per second to miles per hour
Write MATLAB functions to perform the following conversions, taking a value in SI units as the input argument and returning the value to US Customary Units.
a. Length: Centimeters to inches
b. Temperature: °C to °F
c. Force: Newton to Pound-force
d. Speed: Meters per second to miles per hour
Provide the source code and use the following data:
a. 5 centimeter
b. 10 °C
c. 100 Newtown
d. 100 Meters per second
5*double(unitConversionFactor("cm","inch"))
////////////////////////////////////////////////////////////////////////////////
CelsiusToFahrenheit = @(c)c*9/5+32
CelsiusToFahrenheit(10)
////////////////////////////////////////////////////////////////////////////////////////////////////
a = convforce([100],'N','lbf')
////////////////////////////////////////////////////////////////////
a = convvel([100],'m/s','mph')