Borrar filtros
Borrar filtros

How to get all possible arrangements for n=10 and more

4 visualizaciones (últimos 30 días)
Grace
Grace el 18 de Jun. de 2014
Respondida: Marta Salas el 18 de Jun. de 2014
Hi, I wish to get all the possible arrangements for n=10 and more,I used permutation and the output shows me:
>> perms(1:10)
Out of memory. Type HELP MEMORY for your
options.
Error in perms (line 34)
P = V(P);
What can I do except for the permutation in order for me to get all possible arrangements for n=10 and more?Thanks.

Respuestas (1)

Marta Salas
Marta Salas el 18 de Jun. de 2014
http://www.mathworks.com/help/matlab/ref/perms.html [Limitations: perms(v) is practical when length(v) is less than about 10.]
It's quite a big matrix, but it should be able to do the operation if you don't have lots of data already loaded on your workspace.
For n=10 number of permutations is 10! = 3628800 so the size of v is 3628800x10, by default it will do it on double so 0.27Gb. Have you tried to do the operation in uint8?
v = perms(uint8(1:10));

Categorías

Más información sobre Matrices and Arrays 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!

Translated by