I am asked to investigate the different types of interpolation using Matlab for the following points:
x = [32 34 35 36 37 38]
y = [26 28 31 30 29 25]
Interpolation makes sure the values of the interpolated function are the same as the values of original function at the points you provided. Looking at your code, it means that f(35) will be same and will be equal to 31 for every interpolation method.
However, depending on the method of interpolation, the curve between each of the consecutive methods will vary, hence giving you different values, which is expected.