Why the plots of spline and cubic interpolation are exactly same?
The best way to understand cubic splines (under whatever name or how specified) is to derive and code them yourself.
What you are looking for is a parametric equation with these properties:
$$
\begin{aligned}
f(0) &amp;= y[n]    = y_0\\
f(1) &amp;= y[n+1]  = y_1\\
f(2) &amp;= y[n+2]  = y_2\\
f(3) &amp;= y[n+2]  = y_3\\
\end{aligned}
$$
Your candidate function is a cubic polynomial, of course.
$$ f(t) = a t^3 + b t^2 + c t + d $$
Plug 'em in.  You get four equations with four unknowns ($a,b,c,d$)
Once you have solved the equation, use it to interpolate between the middle two points.
Extra credit:
Do the vector equivalent in N-space with the conditions given as two points in space and the velocity vectors at each point with one unit of time to get there.
Then code your solutions.  Print the results so you can see some precision.  And compare your answer to Matlab's.
Then post your results here.