MATLAB: How to get a spline that is bounded by the defined points

spline

Hi I have these points:
But I'd like the line going through to just be a nice curve sort of like this (implemented with splines):
EXCEPT I want the extremities of the spline (for example, here occurring at ~1.75, ~2.9, and ~4.2) to be at 2, 3, and 4! Is there any way to accomplish this? This is mostly for a visual effect, not interested in the fit of the line.
I noticed the first and last points fit well but implementing the spline between each point gives a flat line, which I'm sure if I actually understood anything about splines it might have been possible to predict…
Thanks for any help!

Best Answer

I figured it out! I just needed to use 'cubic'