Question

In: Computer Science

Write MATLAB script programs to perform the following conversions, taking a value in SI units as...

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

Solutions

Expert Solution

5*double(unitConversionFactor("cm","inch"))

////////////////////////////////////////////////////////////////////////////////

CelsiusToFahrenheit = @(c)c*9/5+32

CelsiusToFahrenheit(10)

////////////////////////////////////////////////////////////////////////////////////////////////////

a = convforce([100],'N','lbf')

////////////////////////////////////////////////////////////////////

a = convvel([100],'m/s','mph')


Related Solutions

MATLAB: Write as a script in the editor window of matlab. Quadratic roots. Write a program,...
MATLAB: Write as a script in the editor window of matlab. Quadratic roots. Write a program, quadroots.m, for finding the roots of the second- order polynomial ax2 + bx + c. Use the quadratic equation. The inputs are the coefficients a,b, and c and the outputs are z1 and z2. The program should produce (exactly) the following output in the Command window when run with (a, b, c) = (1, 2, −3):
Write a MATLAB script file that will give the value of f(x) using method of least...
Write a MATLAB script file that will give the value of f(x) using method of least squares and asks the user to enter values of x, y, n (curve fit), and x for f(x).
Write a MATLAB script file that will give the value of f(x) using method of least...
Write a MATLAB script file that will give the value of f(x) using method of least squares and asks the user to enter values of x, y, n (linear, quadratic, or cubic), and x for f(x).
[Solve this problem in Gaussian units and not in SI units.] Write and discuss the equation...
[Solve this problem in Gaussian units and not in SI units.] Write and discuss the equation of motion for one electron of mass me bound to the origin by an elastic force of constant Kel and under the action of a frictional force of coefficient γ and proportional to the velocity.
Write a C++ script to perform the following: a.) Ask a user to enter 2 real...
Write a C++ script to perform the following: a.) Ask a user to enter 2 real numbers. b.) Save the user response as a variable a and b. c.) Display if the numbers are even or odd. d.) Check if the number a belongs in the interval D = [10, 99], display the output as "a is between 10 and 99" or "a is not between 10 and 99". e.) Check if the number b belongs in the interval E...
MATLAB, if-else Write a script which to do the following. Take an array of any size...
MATLAB, if-else Write a script which to do the following. Take an array of any size as input and check if all the elements are integers. (i) If not, display the error message ‘Invalid input!’. Use the error command to create a proper error message in red. (ii) If yes, count the number of rows where the sum of the elements is smaller than the average row sum. It is recommended that you use a test variable with many rows...
write a matlab script for double mass spring system with animation.
write a matlab script for double mass spring system with animation.
Part A: Write a MATLAB script to find the volume of the cylinder in gallons, as...
Part A: Write a MATLAB script to find the volume of the cylinder in gallons, as well as the tank dimensions in feet. Assume that the initial measurements are 7 meters in diameter and 11 meters tall. Display your final answers to the screen using disp and a statement without a semicolon, e.g. write the following into your script disp(‘The capacity in U.S. gallons is:’), capacity, where capacity is a variable that you defined in preceding calculations. Part B: In...
(MATLAB) Write a script that would create a 3x5 matrix of random integers and write this...
(MATLAB) Write a script that would create a 3x5 matrix of random integers and write this new matrix to a file called “Assignment3_Question5.dat”.
Write as a script in the editor window of Matlab: Concession stand. Write a program, ConcessionStand.m,...
Write as a script in the editor window of Matlab: Concession stand. Write a program, ConcessionStand.m, that uses vector-matrix multiplication to tabulate and display the cost of each of the following orders. Assume that a hot dog costs $3.00, a brat costs $3.50, and a Coke costs $2.50. ----------------------------------------------------   hot dogs brats cokes order 1    2 1 3 order 2 1 0 2 order 3 2 2 2 order 4 0 5 1
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT