Filter löschen
Filter löschen

get possible combinations for 3 elements but 5 columns

2 Ansichten (letzte 30 Tage)
Elysi Cochin
Elysi Cochin am 7 Mär. 2017
Bearbeitet: KSSV am 7 Mär. 2017
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...

Akzeptierte Antwort

KSSV
KSSV am 7 Mär. 2017
Bearbeitet: KSSV am 7 Mär. 2017
k = randi(3,1000,5) ;
l = unique(k,'rows') ;

Weitere Antworten (0)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by