different combination of numbers

조회 수: 8 (최근 30일)
salim
salim 2012년 12월 5일
I want to enter 3 numbers and get different combination of numbers which includes duplicate numbers,I mean for numbers(1,2,3) we have 9 combination and i want them all in matrix.how can i have it?
Regards

채택된 답변

Vishal Rane
Vishal Rane 2012년 12월 5일
perms([1 2 3])
Refer perms
  댓글 수: 2
Vishal Rane
Vishal Rane 2012년 12월 5일
although that does not include duplicate numbers
salim
salim 2012년 12월 5일
편집: salim 2012년 12월 5일
thank you about your answer but i think with this example i can explain it more . The command perms([2 4 6]) returns all the permutations of the numbers 2, 4, and 6:
6 4 2
6 2 4
4 6 2
4 2 6
2 4 6
2 6 4
perms returns all permutation of numbers,but i want combination such as 6 6 6 and 4 4 4 and 2 2 2 too.Am i supposed to program it by my self?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Discrete Math에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by