Question
Practice with the command interp1. Write a function in MATLAB called SW to calculate the Specific Weight of Water (in pcf) based on a single
Practice with the command interp1.
Write a function in MATLAB called SW to calculate the Specific Weight of Water (in pcf) based on a single input, the water temperature (in F). The water temperature will be a single variable in the range of 40 deg F to 100 deg F. Predict the value using the command interp1 to perform linear interpolation of the data in the table below.
HINTS:
The input is a single number, the temperature.
You should have a single output equal to the calculated Specific Weight.
The function name must be SW.
Water Temperature (deg F) | Specific Weight (in pcf) |
40 | 62.43 |
50 | 62.41 |
60 | 62.37 |
70 | 62.30 |
80 | 62.22 |
90 | 62.11 |
100 | 62.0 |
You need to copy and paste the data above into your function
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