To answer some of those questions here is an example of input:
x=linspace(-10,10,500);
lagrange(x,[x0,...,xn],[f(x0),...f(xn)])
where [x0,...,xn] is pseudo-code for representing the x values as an array and [f(x0),...,f(xn)]. Then try to plot that lagrange against the function you are interpolating and you should see the desired results.