%Function that implements one-dimensional linear interpolation. It
%requires two points x1 and x2, the function values at these points f(x1)
%and f(x2) and the point for which the function is going to be approximated
%x. Written by Philip Shaw, Fordham University, 2018.
function[fx]=lipvec(x1,x2,fx1,fx2,x)
fx=fx1+((fx2-fx1)/(x2-x1)).*(x-x1);