Matlab Help Write a function that converts temperatures in

Matlab Help :

Write a function that converts temperatures in Celsius to temperatures in Fahrenheit. The function should get two temperatures as input, a lower temperature (Tlow) and a upper temperature (Tupp). The function should convert all of the temperatures between Tlow and Tupp to Fahrenheit. The output of the function should be a two column matrix with the first column showing the temperature in Celsius, from Tlow and Tupp, and the second column showing the corresponding temperature in Fahrenheit.

Solution

% This function is named \'temperature.m\'.
% It has one input value \'x\' and two outputs, \'c\' and \'f\'.

% If \'x\' is a Celsius number, output variable \'f\'
% contains its equivalent in Fahrenheit degrees.
% If \'x\' is a Fahrenheit number, output variable \'c\'
% contains its equivalent in Celsius degrees.

% Both results are given at once in the output vector [c f]

function [c f] = temperature(x)
f = 9*x/5 + 32;
c = (x - 32) * 5/9;

Matlab Help : Write a function that converts temperatures in Celsius to temperatures in Fahrenheit. The function should get two temperatures as input, a lower t

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site