MATLAB: Could anyone help me how to change the number of clusters for every iteration

clustering

I am having an array of data set A=[1 2;
3 4;
5 6;
7 8;
9 10;
11 12]
I want to group A into different number of clusters under the condition the number of clusters should not be more than size(A,1)
I need to run for several iterations.
For every iteration the number of clusters needs to be changed.

Best Answer

A=[1 2;
3 4;
5 6;
7 8;
9 10;
11 12] ;
G = size(A,1) ;
idx = cell(G,1) ;
for i = 1:G
idx{i} = kmeans(A,i) ;
end