function Y = randvec(N,mu,Sigma) % function Y = randvec(N,mu,Sigma) % generate N random points distributed with gaussian % density function with: % mu = mean % Sigma = covariance % the dimension is given by size(mu) D = length(mu); [U,S,V] = svd(Sigma); A = U*sqrt(S); Y = A*randn(D,N) + mu*ones(1,N);