function p = vanderinterp(xdata, fdata, x)
% VANDERINTERP interpolates the given data using the
%              Vandermonde matrix approach
%
% xdata - the x coordinates of the nodes 
% fdata - the function value at the nodes
% x     - 'fine' mesh
% p     - interpolated data on the 'fine' mesh
%
    M = length(xdata);     
	s = size(x);
    
    V = vander(xdata);
    c = V\fdata';
    p = zeros(s);
	for k = 1:M
	    p = c(k) + p .* x; % Horner scheme
	end
end
