function A = m_gauss(b,X) % A = m_gauss(b,X) % % The function returns the exponent values of X(:). The formula is: % $$ A_j = exp(-\frac{(x-\mu_j)^2}{c_j}) $$ % The vector b contains n/2 groups of coefficients: mu(j) = b(2j-1) is a % gaussian shift and c(j) = b(2j) relates to the width of the gaussian. % % 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_gauss([20,0],linspace(0,1,10)) % mu = b(1:2:end-1); % 2 parameters; even parameters are coeffs c = b(2:2:end); % 2 parameters; odd parameters are phase shifts n = length(b)/2; % n components m = length(X); C = repmat(1./c,[m,n]); % prepare a temporary matrix of denominators A = exp( -((repmat(X(:),[1 n])).^2 ) .* C ); return