Putting specific values to a matrix

조회 수: 1 (최근 30일)
Swati Sarangi
Swati Sarangi 2020년 11월 26일
댓글: Swati Sarangi 2020년 11월 27일
Hi ,
I'm having following problem. I have 3 numberx 1,2,3
I've to form a matrix with entries with all possible of numbers using all digits only once.
Thanks.

답변 (1개)

Walter Roberson
Walter Roberson 2020년 11월 26일
values = [1 2 3];
perms(values)
ans = 6×3
3 2 1 3 1 2 2 3 1 2 1 3 1 3 2 1 2 3
  댓글 수: 1
Swati Sarangi
Swati Sarangi 2020년 11월 27일
Thanks for responding but my question is little different. I've to get all possible combinations with repeated values too like 111 112 113 121 122 123 etc. Whatever you've given are just limited values out of many possible combinations ; 27 combinations in total.

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

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by