필터 지우기
필터 지우기

What is the code/command for obtaining permutations with REPETITION ALLOWED for my n^r choices?

조회 수: 1 (최근 30일)
Hi,
I would like to obtain the permutations for my 10 X 10 X 10 OR 10^3 choices.
Is there any direct command or code for that.
I am attaching the three sets of data herewith for your kind reference. I would like to obtain all possible permutations between them. Thank you.

채택된 답변

Walter Roberson
Walter Roberson 2017년 10월 9일
tenchoices = [4 -6 -18 17 2 19 12 3 -11 1];
[F,S,T] = ndgrid(tenchoices);
permutations = [F(:), S(:), T(:)];
  댓글 수: 3
Walter Roberson
Walter Roberson 2017년 10월 9일
tenchoices = load('Permutations.txt');
[F,S,T] = ndgrid(tenchoices(:,1), tenchoices(:,2), tenchoices(:,3));
permutations = [F(:), S(:), T(:)];

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by