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.
1 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File 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!