필터 지우기
필터 지우기

get possible combinations for 3 elements but 5 columns

조회 수: 2 (최근 30일)
Elysi Cochin
Elysi Cochin 2017년 3월 7일
편집: KSSV 2017년 3월 7일
with worker set [1 2 3], i need to get the possible number of allotments we can do for 5 work, that is i need a matrix as below
[1 1 1 1 1
2 2 2 2 2
3 3 3 3 3
1 2 3 1 2
1 2 2 3 3
...
....
..
3 3 3 3 1];
all such combinations.... please can someone help me...

채택된 답변

KSSV
KSSV 2017년 3월 7일
편집: KSSV 2017년 3월 7일
k = randi(3,1000,5) ;
l = unique(k,'rows') ;

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by