So, you can't use existing tools that do create a spline.
You don't want to write a "long" semi-involved script that will work, probably because that would force you to spend the time to really understand how to build a spline.
And you need to use only tools that existed in a fairly old release of MATLAB.
Then sorry, you can't build a spline. At least, I won't write the code for you to use.
You can probably find a code on the file exchange. (Have you bothered to look?) Beware that almost any code on the file exchange that generates a simple cubic spline will probably be worth exactly what you paid for it - NOTHING. (Because they will be the work of a student, as a homework assignment.) So, look on the file exchange, but sift carefully though what you will find. In fact, I just looked on the FEX under "cubic spline", and I saw very little that I would recommend. You won't be able to use my SLM toolbox up there, which while that would in theory solve your problem, it calls the optimization toolbox in some cases. That would probably make it unacceptable for code generation.
You MIGHT try this one:
It should be decent code, since I would trust the author. I have no idea if it will be viable for code generation though.
Best Answer