I want to show a local optimum in my paper, how do I generate the data for it? I'm writing a paper where I am explaining the problems of local optimum in my clustering algorithm. While clustering, in my data I would at times get local optimums. But I've tried and I cannot recreate the same effect as I cannot find that particular input data that converged locally.
I want to show the local optimum in plot and 3Dplot in matlab. I cannot copy the images found online for obvious reasons. 
Is there a way to generate my local optimum? How do I generate my random data to achieve this?
 A: The figure you linked shows multiple minima as a function of a single parameter. The Gaussian mixture model has many parameters. Here's a way to do something different, which is to show different solutions, each understandable as a local minimum, but with different likelihoods.
%% Generate random normal data and form four clusters from them
x = randn(100,1);
y = randn(100,1);
X = [x y; x+20 y; x+4 y+10; x+16 y+10];

% Fit a GMM with 3 components, one set of starting values
subplot(1,2,1)
plot(X(:,1),X(:,2),'.')
S.mu = [0 0;20 0; 10 10];
S.Sigma = repmat(eye(2),[1 1 3]);
gmm1 = fitgmdist(X,3,'Start',S)
hold on
ezcontour(@(x,y) pdf(gmm1,[x(:),y(:)]),[-5 25 -5 15])
hold off
title(sprintf('Neg log lik = %g',gmm1.NegativeLogLikelihood))

% Change the starting values to get a different solution
subplot(1,2,2)
plot(X(:,1),X(:,2),'.')
S.mu = [0 10;4 10; 10 0];
S.Sigma = repmat(eye(2),[1 1 3]);
S.Sigma(:,:,1) = [100 0;0 1];
gmm2 = fitgmdist(X,3,'Start',S)
hold on
ezcontour(@(x,y) pdf(gmm2,[x(:),y(:)]),[-5 25 -5 15])
hold off
title(sprintf('Neg log lik = %g',gmm2.NegativeLogLikelihood))


