function coef=LagrangeInterpolation(xx,yy)
%get the ploynimial coefficients of Lagrange interpolation.
%input is a set of sample points
%output is the coefficients of Lagrange interpolation.
syms x
y=0;
%start to implement the Lagrange interpolation
for i=1:length(xx)
p=1;
for j=1:length(xx)
if(j~=i)
p=p*(xx(j)-x)/(xx(j)-xx(i));
end
end
y=y+p*yy(i);
end
%get the coefficients of polynimial
coef=sym2poly(y);
return