Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

*FOURTH TIME UPLOADING THIS, IT SHOWS ERROR EVERY TIME I RUN IT * I WILL ATTACH THE ERROR AND THE CODE, *PLEASE SOLVE THE CODE

*FOURTH TIME UPLOADING THIS, IT SHOWS ERROR EVERY TIME I RUN IT * I WILL ATTACH THE ERROR AND THE CODE,

*PLEASE SOLVE THE CODE USING MATLAB, AND PLEASE VERIFY YOUR STEPS & OUTPUT*

QA:

image text in transcribed

MY ANSWER:

image text in transcribed

THE ERROR I AM GETTING:

image text in transcribed

Write a program that performs the unit conversions listed below. Note that you must perform both the regular mathematical conversion using basic arithmetic calculations as well as using the unitConvert() function. Please be aware that this means you will do every conversion TWICE, but the solutions should match even though the approaches differ! The following are the conversions you must complete: - Convert 3 miles to inches - Convert 5,250,000 millimeters to Megameters - Convert 250 pounds to kilograms - Convert 37 cubic yards to cubic millimeters MEASURE: - What measurement (and unit) are you provided? - What unit should be included in the final result (after converting)? ANALYZE: - How do you perform a unit conversion MATHEMATICALLY (without using unitConvert)? - How do you create units within MATLAB? - How do you perform the unit conversion operation with the unitConvert function? IMPROVE: Code your solution in MATLAB, making sure that your solution both runs and produces the desired results. Then, turn in a PDF of your code to the D2L Dropbox following the naming format: lastName_firstName_UnitConversionCode.pdf Note that you can simply copy and paste your code into a program like Microsoft Word and save the file as a PDF or use the publish command to easily generate a PDF of your code. Remember that there is a special folder named "Late Labs" for anyone who misses the deadline but still wishes to submit their lab. Note that this DropBox also has a date where it will lock, and any assignments submitted here will be subject to a 30 -point penalty. \% Create units for inches, megameters, kilograms, and cubic millimeters inch = unitConversionFactor ('inches', 'in'); megameter = unitConversionFactor ('megameters', 'Mm'); kilogram = unitConversionFactor('kilograms', 'kg'); cubic_millimeter = unitConversionFactor ('cubic millimeters', 'mm^3'); \% Convert 3 miles to inches miles =3; inches_math = miles 63360;% Mathematical conversion using conversion factor inches_unitConvert = unitConvert(miles, 'miles', inch); \% Unit conversion using unitConvert function disp(['3 miles is equal to ', num2str(inches_math), ' inches (mathematical)']); disp(['3 miles is equal to ', num2str(inches_unitConvert), 'inches (unitConvert)']); \% Convert 5,250,000 millimeters to megameters milimeters =5250000; megameters_math = millimeters / (106);% Mathematical conversion by dividing by 1 million megameters_unitConvert = unitConvert(millimeters, 'millimeters', megameter); \% Unit conversion using unitConvert function disp(['5,250, 000 millimeters is equal to ', num2str(megameters_math), ' megameters (mathematical)']); disp(['5,250,000 millimeters is equal to ', num2str(megameters_unitConvert), ' megameters (unitConvert)']); % Convert 250 pounds to kilograms pounds = 250; kilograms_math = pounds / 2.20462;% Mathematical conversion by dividing by 2.20462 kilograms_unitConvert = unitConvert(pounds, 'pounds', kilogram); % Unit conversion using unitConvert function disp(['250 pounds is equal to ', num2str(kilograms_math), ' kilograms (mathematical)']); disp(['250 pounds is equal to ', num2str(kilograms_unitConvert), 'kilograms (unitConvert)']); \% Convert 37 cubic yards to cubic millimeters cubic_yards = 37; cubic_millimeters_math = cubic_yards * (764554857.984); \% Mathematical conversion using conversion factor cubic_millimeters_unitConvert = unitConvert(cubic_yards, 'cubic yards', cubic_millimeter); \% Unit conversion using unitconvert function disp(['37 cubic yards is equal to ', num2str(cubic_millimeters_math), ' cubic millimeters (mathematical)']); disp(['37 cubic yards is equal to ', num2str(cubic_millimeters_unitConvert), 'cubic millimeters (unitConvert)']); >> untitled Error using unitConversionFactor First argument must be a unit. Error in untitled (line 2) inch = unitConversionFactor ('inches', 'in'); Related documentation >>

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

10th Edition

0137916787, 978-0137916788

More Books

Students also viewed these Databases questions

Question

=+What is the extent of the use of each type of IE?

Answered: 1 week ago