What is the code/command for obtaining permutations with REPETITION ALLOWED for my n^r choices?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Ismail Qeshta
el 9 de Oct. de 2017
Comentada: Ismail Qeshta
el 9 de Oct. de 2017
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.
0 comentarios
Respuesta aceptada
Walter Roberson
el 9 de Oct. de 2017
tenchoices = [4 -6 -18 17 2 19 12 3 -11 1];
[F,S,T] = ndgrid(tenchoices);
permutations = [F(:), S(:), T(:)];
3 comentarios
Walter Roberson
el 9 de Oct. de 2017
tenchoices = load('Permutations.txt');
[F,S,T] = ndgrid(tenchoices(:,1), tenchoices(:,2), tenchoices(:,3));
permutations = [F(:), S(:), T(:)];
Más respuestas (0)
Ver también
Categorías
Más información sobre Descriptive Statistics and Visualization en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!