Question

Needs to be solved in MATLAB

Problem 4 Produce a conversion table for Celsius and Fahrenheit temperatures. The input to the function should be two numbers

0 0
Add a comment Improve this question Transcribed image text
Answer #1

a) Function file

function [T C]=fahrenheit2celcius(Tlower,Tupper)
Fahrenheit=Tlower:5:Tupper;
Celcius=(5/9).*(Fahrenheit-32);
T=Fahrenheit';
C=Celcius';
end

b) Script file

clc;clear all;
Tlower=32; %lower limit in degree Fahrenheit
Tupper=212;%upper limit in degree Fahrenheit
fprintf('Fahrenheit     Celcius');
[T C]=fahrenheit2celcius(Tlower,Tupper);
ans=[T C]
k=find(T==57);
fprintf('Temperature in Celcius for 57 def F= %f\n',C(k))

k1=find(T==107);
fprintf('Temperature in Celcius for 57 def F= %f\n',C(k1))

k2=find(T==192);
fprintf('Temperature in Celcius for 57 def F= %f\n',C(k2))

Command Window Fahrenheit Celcius ans 32.0000 37.0000 2.7778 42.0000 5.5556 47.0000 8.3333 11.1111 52.0000 57.0000 13.8889 62102.0000 38.8889 107.0000 41.6667 112.0000 44.4444 117.0000 47.2222 122.0000 50.0000 127.0000 52.7778 132.0000 55.5556 58.333

Add a comment
Know the answer?
Add Answer to:
Needs to be solved in MATLAB Problem 4 Produce a conversion table for Celsius and Fahrenheit...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • C++ Code needed    Celsius Temperature Table The formula for converting a temperature from Fahrenheit to...

    C++ Code needed    Celsius Temperature Table The formula for converting a temperature from Fahrenheit to Celsius is C =5/9(F -32) where F is the Fahrenheit temperature and C is the Celsius temperature. Write a function named celsius that accepts a Fahrenheit temperature as an argument. The function should return the temperature, converted to Celsius. Demonstrate the function by calling it in a loop that displays a table of the Fahrenheit temperatures 0 through 20 and their Celsius equivalents.

  • Temperature Converter Create a temperature conversion program that will convert the following to Fahrenheit: Celsius Kelvin...

    Temperature Converter Create a temperature conversion program that will convert the following to Fahrenheit: Celsius Kelvin Newton Your program should take a character which represents the temperature to convert from and a value to be converted to using the following specification: C - Celsius K - Kelvin N - Newton In addition your program should take in the following character to exit the program: X - eXit the program The numeric input for your program should be of type double....

  • 7. Celsius Temperature Table The formula for converting a temperature from Fahrenheit to Celsius is the...

    7. Celsius Temperature Table The formula for converting a temperature from Fahrenheit to Celsius is the Fahrenheit temperature and C is the Celsius temperature. Write a func- he func- tion named celsius that accepts a Fahrenheit temperature as an argument. I tion should return the temperature, converted to Celsius. Demonstrate t he function by calling it in a loop that displays a table of the Fahrenheit temperatures 0 through 20 and their Celsius equivalents.

  • This program will take the user's input as a temperature in degrees Fahrenheit. The user will...

    This program will take the user's input as a temperature in degrees Fahrenheit. The user will then click a radio button indicating whether a table of temperatures, starting with the entered value, will be displayed in increments of 5 degrees F or 10 degrees F. When a submit button is clicked your code will display a HTML table of temperature values. The first column will be temperatures in degrees Fahrenheit, given in increments of 5 or 10 degrees F, depending...

  • Write a program in java that generates a two-column table showing Fahrenheit temperatures from -40F to...

    Write a program in java that generates a two-column table showing Fahrenheit temperatures from -40F to 120F and their equivalent Celsius temperatures. Each line in the table should be 5 degrees F more than the previous one. Both the Fahrenheit and Celsius temperatures should be accurate to 2 decimal place.

  • General overview This program will convert a set of temperatures from Fahrenheit to Celsius and Kelvin....

    General overview This program will convert a set of temperatures from Fahrenheit to Celsius and Kelvin. Your program will be reading in three double values. The first values are starting and ending temperatures. The third value is the increment value. There is no prompt for the input. There is an error message that can be displayed. This is discussed later. You need to display output for all of the values between the starting and ending values. First two values are...

  • in matlab Fahrenheit and Celsius are related by equation: TeT 32)/1.8 Create a function called tempConv...

    in matlab Fahrenheit and Celsius are related by equation: TeT 32)/1.8 Create a function called tempConv that will convert temperature between Fahrenheit and Celsius The function should have two input parameters: one is a single temperature in degrees and the other one is the input temperature scale character 'C'or 'F The function should return the converted temperature as variable temp

  • R-Studio (R Programming Language) 9. The conversion from a temperature measurement in degrees Fahrenheit F to...

    R-Studio (R Programming Language) 9. The conversion from a temperature measurement in degrees Fahrenheit F to Celsius C is performed using the following equation `C = 5/ 9 (F - 32)` Use vector-oriented behavior in R to convert the temperatures `45, 77, 20, 19, 101, 120, and 212` in degrees Fahrenheit x_fahren` to degrees Celsius `x_cel`. ```{r} #insert your code ``` 10. Use the function `paste` to create the following character vectors of length 25: `("label 1", "label 2", .....,...

  • Fahrenheit scale is a temperate scale and it uses the degree Fahrenheit (symbol °F) as the...

    Fahrenheit scale is a temperate scale and it uses the degree Fahrenheit (symbol °F) as the unit. Celsius scale is another temperature scale and its symbol is °C. Fahrenheit is used by United States whereas all other countries in the world use Celsius. The formulas of conversion between Fahrenheit and Celsius are as follows: From Fahrenheit: [°C] = ([°F] − 32) × 5⁄9 From Celsius: [°F] = [°C] × 9⁄5 + 32 Write a function named convertTemp( degree, ForC )...

  • this is MatLab question Exercise Create a table that illustrates the relationship between temperature in degrees...

    this is MatLab question Exercise Create a table that illustrates the relationship between temperature in degrees Celsius and the corresponding temperature in degrees Fahrenheit, from -40 to 100 degrees C in increments of 5 degrees. The conversion formula is as follows: °F=2°C+32 Store the both set of values in vectors while using a for loop. Use variable names TinC and TinF Check the temperatures that we all may know the conversion, e.g., 0 C = 32 F and 100 C...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT