title: Cubic spline interpolation vs polynomial interpolation
body: <p>I am asked to investigate the different types of interpolation using Matlab for the following points: </p>
  
  <pre><code>x = [32 34 35 36 37 38]
  y = [26 28 31 30 29 25]
  </code></pre>
  
  <p>and find the values for <code>f(33)</code>, <code>f(33.5)</code> and <code>f(35)</code>.</p>
  
  <p>When plotting x and y, I can see that <code>f(33)</code> should be around 27, which is also what I get using <code>interp1(x,y,33)</code>.</p>
  
  <p>I am not sure if this is the correct way of using the Cubic spline interpolation function but I used <code>spline(x,y,33)</code> and got <code>ans = 24.3906</code>. </p>
  
  <p>Shouldn't I still get the same value for <code>f(33)</code> no matter what type of interpolation I use? </p>