필터 지우기
필터 지우기

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

조회 수: 2 (최근 30일)
Grace
Grace 2014년 6월 18일
답변: Marta Salas 2014년 6월 18일
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.

답변 (1개)

Marta Salas
Marta Salas 2014년 6월 18일
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));

카테고리

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