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!