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 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, 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...
(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 a MATLAB script file to numerically solve any first order initial value problem using Rulers...
Write a MATLAB script file to numerically solve any first order initial value problem using Rulers method. Once code is working use it to solve the mixing tank problem below. Use a step size of 1 minute, and simulate the solution until the tank contains no more salt. Plot both the Euler approximation and the exact solution on the same set of axes. A tank contains 100 gallons of fresh water. At t=0 minutes, a solution containing 1 lb/gal of...
Write and upload a MATLAB script to do the following. Compute the sequence S(n+1) = (2...
Write and upload a MATLAB script to do the following. Compute the sequence S(n+1) = (2 – K) S(n) – S(n-1) ;   Assume S(1) = 0, S(2) = 1; (a)    Case 1, Assume K = 1 (b)    Case 2, Assume K = 2 (c)     Case 3, Assume K = 4 Plot all of these on the same plot, for N = 1 to 20
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT