MATLAB CODE-------------------------------------------
clc;
clear all
x=27;
T=[0 8 16 24 32];
O=[14.621 11.843 9.870 8.418 7.305];
n=size(T,2);
L=ones(n,size(x,2));
for i=1:n
for j=1:n
if (i~=j)
L(i,:)=L(i,:).*(x-T(j))/(T(i)-T(j));
end
end
end
y=0;
for i=1:n
y=y+O(i)*L(i,:);
end
fprintf('Interpolated value of Y for x=27 is = %d',y)
OUTPUT-----------------------------------------------
Interpolated value of Y for x=27 is = 7.96742
by matlab 2. The following data defines the sea-level concentration of dissolved oxygen for fresh water as a function of temperature: T0 8 16 24 32 14.621 11.843 9.870 8.418 7.305 Write a MATLAB c...
2. The following data defines the sea-level concentration of dissolved oxygen for fresh water as a function of temperature: T0 O 14.621 11.843 9.870 8.418 7.305 8 16 24 32 Write a MATLAB code for Lagrange Interpolation to find 1st degree and 2nd degree polyno- mial approximation to the value of O(27)
2. The following data defines the sea-level concentration of dissolved oxygen for fresh water as a function of temperature: T0 O 14.621 11.843 9.870 8.418 7.305 8 16...
please help with #1 a and b. thank you
Use the following data for all problems: The data below defines the sea-level concentration of dissolved oxygen for fresh water as a function of temperature: T°C omg/L 0 8 16 14.621 11.843 9.870 24 32 40 8.418 7.305 6.413 a. Approximate o(19) using a 1st order Newton's interpolating polynomial. b. Approximate o(19) using a 2nd order Newton's interpolating polynomial. 2) Use linear algebra to find the coefficients of the 2nd order...
matlab please
TABLE P15.5 Dissolved oxygen concentration in water as a function of temperature (°C) and chloride concentration (O/L). Dissolved Oxygen (mg/L) for Temperature (C) and Concentration of Chloride (g/L) C=Og/L c=10 g/l c=20 g/L 14.6 12.9 11.4 12.8 11.3 10.3 11.3 10.1 8.96 10.1 9.03 8.08 9.09 8.17 7.35 8.26 7.46 6.73 6.85 6.20 1.56 the percent relative error for your prediction. Explain pos sible causes for the discrepancy. 15.7 As compared with the models from Probs. 15.5 and...