Question
Write a matlab program for the following: You are constructing a program to convert the specific heat of common materials from units of calories per
Write a matlab program for the following: You are constructing a program to convert the specific heat of common materials from units of calories per gram degree Celsius to units of British thermal units per pound-mass degree Fahrenheit. A file named SpecificHeat.mat is available online. Place this file into your MATLAB directory. Following the housekeeping commands, use the load command to load the contents of this file into your workspace [load('SpecificHeat.mat')]. This will place the variable SpHeat into your workspace. SpHeat is a two column cell array containing the following initial compounds and associated specific heat values: Aluminum, 0.22; Calcium, 0.15; Gold, 0.031; Silicon, 0.17; Zinc, 0.093. Instruct the user to select a material from a menu or enter a new material name [see sample menu shown]. If the user closes the menu, issue a warning message and redisplay the menu until the user makes a correct choice. If the user chooses to enter a new material, the user should be prompted to enter the material name and the specific heat of the material in units of calories per gram degree Celsius. This new material should be stored in a new row at the bottom of the cell array with the original data. Once the new material has been entered, save the revised cell array variable to SpecificHeat.mat. [Refer to the documentation files on the save command if you do not know how to do this.] Note that if you run the program again after this that SpHeat will contain the newly added data when you load the variable from SpecificHeat.mat. For the compound either chosen or entered by the user, convert the specific heat value to units of British thermal units per pound-mass degree Fahrenheit. Display in the Command Window both values similar to the output shown below, using three decimal places for the values. Ask the user if they wish to run the program again, using a menu. Repeat the program until the user chooses to terminate the program. Here, the value of X.XXX will be replaced with the actual problem results.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started