% The function builds the matrix of basis Cheby I in x, given n function P = Base_ChebyX(n,x) %% x = x(:); N = n+1; P=zeros(length(x),N); P(:,1)=1; P(:,2)=x; for k=2:n P(:,k+1)= 2*x.*P(:,k)-P(:,k-1); end %%