function [yi] = evalpoly(a,xi)
%
% This function evaluates a polynomial p(x) with 
% coefficients a=[a(1) ... a(n)] (order n-1) 
% at locations x= [x(1) ... x(m)]
%
% Input a  -> vector of coefficients (row or column)
%       xi -> vector of nodes (column vector)
% 
% Output yi-> p(xi) = a(1)+ a(2)*xi + .... + a(n)*xi^(n-1)

n=length(a);
m=length(xi);

yi=ones(m,1)*a(1);

for ii=2:n
    yi=yi + a(ii)*xi.^(ii-1);
end


