1 / 3100%
1
ENGR 133, Lab-04
Authored by: Luke Thompson
Created 10/13/2021 on:
Exercise ... Problem 3.7 with Function File#1
Problem presentation
We are asked write a function that accepts a temperature expressed degrees Fahrenheit (F) and computes to in
the corresponding value degrees Celsius (C). We are further instructed test our functions. in to
Function file definition:
funtion y = tempF2C(x)
y = (5/9)*(x- 32)
end
Initialize Variables
Perform Calculations
Display Results
The test temperatures are (degrees F):
-460 32 212
The computed temeratures are(degrees C):
-273.3333 0 100.0000
Exercise ... Problem 3.7 with Anonymous Function#2
Problem presentation
disp(test_results_C)
disp(test_temps_F)
clc,clear,close all
test_temps_F = [-460 32 212]; % test temperatures defined at key known points
test_results_C = tempF2C(test_temps_F); % calls function with test points
fprintf('The test temperatures are (degrees F):\n\n')
fprintf('\n\nThe computed temeratures are(degrees C):\n\n')
clc,clear,close all
2
We are asked to write a function that accepts a temperature expressed in degrees Fahrenheit (oF) and
computes the corresponding value degrees Celsius (oC). in We are further instructed test functions. to our
Function file definition:
Students also viewed