random clustering of any number of rows and columns

1 次查看(过去 30 天)
The following code executes
A=[0 0 41 0 0;
0 0 0 42 0];
non_0=sum(A);
non_0=repmat(non_0,2,1);
A_part=[1 2 3 4 5;
21 22 23 24 25];
new_A=A;
new_A(non_0 & A==0)=A_part(non_0 & A==0);
but I want to have for n number of rows and m number of columns and the rows of matrix of A and A_part should be clustered in the random manner as per the above code mentioned.In addition each cluster can have any number of rows.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by