PROFESSIONAL ACADEMIC STUDY RESOURCES WEBSITE +1 813 434 1028  proexpertwritings@hotmail.com

i have a matlab homework

Description

Students must provide the original m-file and a separate pdf copy of the code and the output. To do this submit

an electronic copy of the M-file, filename.m (this is also known as the editor file or the script file). Also

provide a pdf copy of the m-file which is the code and provide a pdf copy of the output. This can be done by

print to pdf from the editor and from the command window or you can publish the file which combines both.

(Example)

Item#1.

Name and Date:

Mr. Satel Light and date

Course and Section: ENGR XXX and class # XXXXX

Problem and Statement: Matlab Homework 10, problem #4 parts C and D – Key information about problem

(use filename system: Lastname_hot_initial.m )

Write an mfile using the switch statement to allow the user to choose what temperature scale they would like to

use for the input value:

Celsius, Fahrenheit or Kelvin.

The program will accept a temperature from the user in their scale and produce an output of a temperature in the

other scales. The user should specify the value of the temperature as a numeric input and the temperature scale

as a “string” or “character” input.

The scales used for this assignment are Celsius, Kelvin and Fahrenheit.

The following problem considers temperature conversions. The program must use the following

equations and any algebraic manipulation of the following equations that give relationships between

temperatures in Fahrenheit (TF), Celsius (TC), Kelvin (TK), and

Rankine (TR):

Use fprintf to output the data in complete sentences. Also restate the input data (showing 1 decimal place for

the input temperature scale of data) and then state the data in the equivalent scales.

Output the Celsius temperature in a decimal format with 2 decimal places.

Output the Fahrenheit temperatures in a decimal format with 3 decimal places.

Ouput the Kelvin temperature in scientific notation with 3 decimal places.

Put in a condition of error in the program if the wrong “string” or wrong “character” is given.

Use fprintf to notify the user of the error.

Use the following data for input that will be submitted as the execution of the program:

Run the program for execution#1 – c, C, 88 degrees Celsius,

Run the program for execution#2– f, F, 74 degrees Fahrenheit,

Run the program for execution#3 – k, K, 125.5 degrees Kelvin.

Run the program for execution#4 – Any different letters, error message.

Execute the program 4 times in the command window to show each scenario given in the sample output.

Sample Output – Scenario1 – Matlab Execution #1

(Heading goes here)

Enter your first name. >>: Maria

What scale is your temperature on?

Enter c, C-for Celsius: f, F-for Fahrenheit: k, K-for Kelvin: c

Please enter the temperature value: 88.0

Celsius Scale Results

88.0 degree Celsius is equal to XXXX Fahrenheit.

88.0 degree Celsius is equal to XXXX Kelvin.

Sample Output – Scenario2 – Execution #2

(Heading goes here)

Enter your first name. >>: Maria

What scale is your temperature on?

Enter c, C-for Celsius: f, F-for Fahrenheit: k, K-for Kelvin: f

Please enter the temperature value: 74.0

Fahrenheit Scale Results:

74.0 degree Fahrenheit is equal to XXXX degree Celsius.

74.0 degree Fahrenheit is equal to XXXX Kelvin.

Sample Output – Scenario3 – Execution #3

(Heading goes here)

Enter your first name. >>: Maria

What scale is your temperature on?

Enter c, C-for Celsius: f, F-for Fahrenheit: k, K-for Kelvin: K

Please enter the temperature value: 125.5

Kelvin Scale Results:

125.5 Kelvin is equal to XXXX degree Celsius.

125.5 Kelvin is equal to XXXX degree Fahrenheit.

Sample Output Scenario4 – Execution # 4

(Heading goes here)

Enter your first name. >>: Maria

What scale is your temperature on?

Enter c, C-for Celsius: f, F-for Fahrenheit: k, K-for Kelvin: XX

(Error message of your choice – keep it nice and cl

Share your love

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Leave a Reply

Your email address will not be published. Required fields are marked *