idx = kmeans(X1,2);
% Plot results
hold on
plot(X(idx==1,1), X(idx==1,2), 'r.')
plot(X(idx==2,1), X(idx==2,2), 'g.')
plot(X(idx==3,1), X(idx==3,2), 'b.')
X must have more rows than the number of clusters.
Error in Untitled (line 2)
idx = kmeans(E1,2);
tried in this way to make all the mistake ps I have a 2x1000 matrix