function A = m_poly(b,X) % A = m_poly(b,X) % % The function returns the polynomial items of X(:). The formula is: % $$ A_j = x^{j-1}, j=1,...b $$ % The vector b is degree+1 of the polynomial. % % Notation: % X [m x 1] is an input column vector, % b [1 x 1] is degree+1 of the polynomial. % A [m x b] is an output matrix of the non-linear mappings, where each % column corresponds to an item of the further linear combination. % % Example % y = m_poly(2,linspace(0,1,10)) % a straight line % A = repmat(X(:),[1 b(1)]); % calculate columns of the matrix % where each column corresponds to the corresponded degree of the polynomial. for j = 1:b(1) A(:,j)=A(:,j).^(j-1); end return