This strikes me as a homework question, which may end up requiring a very different format of an answer. Are you simply generating a set of points representing the interpolating function? And if so, how are you proving that this is a "smooth function"?
If you're fine solving this with MATLAB commands I think you might try something like
yi = interp1( x, y, xi, 'cubic' );
If you also need to know the exact expressions for each spline function (in order to prove that your solution is in fact smooth) then you'll also want to do something like
pp = interp1(x,y,'cubic','pp')
Then you'd have to show that the derivatives match at all of the points in x.
But be warned that if this is a homework assignment and the entire point is for you to set up and solve the system of equations that results from setting up your spline with the necessary conditions at each point in x then interp1 probably won't get you full credit.
It seems to me you could also solve this problem by interpolating with sine or cosine functions and that might even require less work than a cubic spline.