In: Mechanical Engineering
The following table gives temperature data in *C as a function of time of day and day of the week at a specific location. Data are missing for the entries marked with a question mark (?). Use linear interpolation with MATLAB to estimate the temperature at the missing points.
Directly using the inbuilt function interpl() in MATLAB to find the values of missing data
%code to interpolate the values
clc
Tues = [15 14 15 18];%data given
x = interp1([1 3 4 5],Tues,2); %2 shows here the the 2nd place needs to be find
Thurs = [16 11 15 20];
y = interp1([1 2 4 5], Thurs,3);
Answer :
x = 14.5
y = 13
x = 14.5
y = 13