Combinations and memory uses
이전 댓글 표시
v = uint16([1 10 11 12 13 14 16 18 21 22 23 24 26 32 35 36 37 39 41 42 44 46 56 57 58 59 62 66 68 69 71 72 73 77 80]);
C = nchoosek(v,uint16(22))
I try this code for combination but use memory in matlab is very huge and take time
Can you help me?
채택된 답변
추가 답변 (1개)
If the values of your vector are smaller than 256, you can convert them in the type uint8 and use FEX: vchookek.mex . Matlabs nchoosek used double values, at least in older Matlab versions. Reducing the tapy of the data as far as possible might allow to squeeze the data into your RAM.
There are many other useful submissions in the FileExchange, e.g. FEX:a-fast-nchoosek-alternative-for-engineers-who-like-fast-nchoosek-alternatives
카테고리
도움말 센터 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!