However, to be able to test a GMM, it is necessary to generate random vectors from Gaussian distributions. While it is true that Matlab has a function call mvnrnd() for this purpose, I have developed a function that produces a very similar result with great ease. You can click here for a detailed explanation of the code:
%% Function
% Generates normally distributed values
function p = normalMulti(mu, sigma, cases)
[row col] = size(mu);
if(col ~= 1)
mu = mu';
[row col] = size(mu);
end
[V D] = eig(sigma);
A = V*sqrt(D);
p = A*randn(row,cases) + repmat(mu,1,cases);