Question: Develop a function called h 2 0 rho _ SI . m that accepts temperature in degrees Celsius and outputs density in kg / m

Develop a function called h20rho_SI.m that accepts temperature in
degrees Celsius and outputs density in kg/m^3. Do this by interpolating
the data in table A.8. The output of the function should be the same size
as the input. If the user inputs a single temperature, the function should
return a single density. If the user inputs a matrix of temperatures, the
function returns a matrix of densities at those temperatures. Submit your
commented code and a command line call to the function for temperatures
0,50, and 100 deg C to show the function works.
EXAMPLE FUNCTION:
function [y_out]= blah(x_in)
%Blah accepts an x input and provide the interpolated y
output
%INPUTS:
%x_in nxn matrix of request x point
%OUTPUT
%y_out nxn matrix of interpolated data at x_in points
%Author:
%Date:
%Version:
%Change log:
%
%%%%%%%%
x_data =[0123456];
y_data =[0149162536];
y_out = interp1(x_data,y_data,x_in);
end

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!