function p = ipolvander(x,y)
% Computation of polynomial interpolating in (x(i),y(i)) in monomial
% representation: UNSTABLE due to ill-conditioning of monomial basis
% Note: return vector p is a row vector with leading coefficient in 
% p(1), agrees with MATLAB's convention for polyval().
n = length(x); if (length(y) ~= n), error('data size mismatch'); end
x = reshape(x,1,n); y = reshape(y,1,n); % data as row vectors
% Initialize interpolation matrix, here the Vandermonde matrix
V = repmat(x',1,n).^repmat((n-1:-1:0),n,1);
p = (V\y')';
