% Generate some clusters
K = 4;
N = 12;
centers = randn(2,K);
H = repmat(centers,1,N/K) + randn(2,N)*.1;
% c(i,j) row j belong to cluster i
c = binvar(K,N,'full')
Model = [sum(c,1)==1];
objective = 0;
for i = 1:K
objective = objective + logdet(eye(2) + H*diag(c(i,:))*H');
end
ops=sdpsettings('solver','bnb','bnb.solver','sdpt3')
optimize(Model,-objective,ops)
value(c)
I get the following message when I try to run the code. The answer that I get is all Nan.function cost = computecost(f,c,Q,x,p);
cost = f+c'*x+x'*Q*x;if ~isequal(p.K.m,0) top = size(p.F_struc,1)-sum(p.K.m.^2)+1; for i = 1:length(p.K.m) X = p.F_struc(top:top + p.K.m(i)^2-1,:)*[1;x]; X = reshape(X,p.K.m(i),p.K.m(i)); cost = cost - sum(real(log(real(eig(X))))); top = top + p.K.m(i)^2; endend