how to distribute a matrix elements randomly matlab
이전 댓글 표시
hi everyone how to make a matrix randomly distributed to another matrix n,
m = [ 1 1 3 3 3 4 4 6 6 7 7 7];
n = zeros(3,10);
the same value must in the sequence, ex : 4 4 4, 7 7 7.result reqiured can be something like {or other combinations):
distributed_matrix =
0 1 1 0 7 7 7 0 0 0
0 0 3 3 3 4 4 0 0 0
6 6 6 0 0 0 0 0 0 0
댓글 수: 5
Image Analyst
2016년 10월 9일
편집: Image Analyst
2016년 10월 9일
Seems like an unusual, quirky thing to want to do. Is this homework? Hint: try unique() and randi(). Note, though it's solvable for that specific m and n, it may not be possible to solve for an n of that size (3x10) and any arbitrary m.
Massimo Zanetti
2016년 10월 9일
So Image Analyst.. please do his thesis work! Come on!
Marc Jakobi
2016년 10월 9일
You should post what you have attempted so far, if it is homework; even if the results are wrong - to show that you at least tried.
wee
2016년 10월 9일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!