In MATLAB, we can use the built-in function polyfit to find the coefficients c1 and c2 of the linear interpolating polynomial p(x) = c1*x + c2.
Here's an example code to find the coefficients for some sample data:
main.m192 chars10 lines
The output will be something like:
main.m23 chars2 lines
So the basis functions for this linear interpolating polynomial are:
main.m23 chars2 lines
gistlibby LogSnag