Daniel@0: function x = mixgauss_sample(mu, Sigma, labels) Daniel@0: % MIXGAUSS_SAMPLE Sample from a mixture of Gaussians given known mixture labels Daniel@0: % function x = mixgauss_sample(mu, Sigma, labels) Daniel@0: Daniel@0: T = length(labels); Daniel@0: [D Q] = size(mu); Daniel@0: x = zeros(D,T); Daniel@0: for q=1:Q Daniel@0: ndx = find(labels==q); Daniel@0: x(:,ndx) = gaussian_sample(mu(:,q)', Sigma(:,:,q), length(ndx))'; Daniel@0: end