function V=vander1(x,k) % function V=vander1(x,k) % Creates a partial Vandermonde matrix from the data in x- k is % for the highest power (so V has k+1 columns). % % INPUT: A column vector x (length m) and a positive number k. % OUTPUT: V is m x k, with powers of x. The first col is x^k x=x(:); m=length(x); V=ones(m,k+1); for j=1:k+1 V(:,j)=x.^(k+1-j); end