function A = m_sin(b,X) % A = m_sin(b,X) % % The function returns the exponent values of X(:). The formula is: % $$ A_j = sin (c_j x + s_j) $$ % The vector b contains n/2 groups of coefficients: c(j) = b(2j-1) is a % coefficient before x and s(j) = b(2j) is a phase shift. % % Notation: % X [m x 1] is an input column vector, % b [1 x 2n] is a parameters vector, where n is a number of items in the % non-linear mapping. % A [m x n] is an output matrix of the non-linear mappings, where each % column corresponds to an item of the further linear combination. % % Example % y = m_sin([20,0],linspace(0,1,10)) % c = b(1:2:end-1); % 2 parameters; even parameters are coeffs s = b(2:2:end); % 2 parameters; odd parameters are phase shifts n = length(b)/2; % n components m = length(X); A = repmat(X(:),[1 n]) * diag(c) + repmat(s,[m 1]); A = sin( A ); return