function lambda=BarycentricCoefficients(x)
% BARYCENTRICCOEFFICIENTS barycentric coefficients for interpolation
%   lambda=BarycentricCoefficients(x); computes the coefficients for
%   the barycentric representation of the interpolating polynomial
%   through the points (x,.)

n=length(x); x=x(:);
for k=1:n,
  lambda(k)=1/prod(x(k)-x([1:k-1,k+1:n]));
end;