简体   繁体   中英

Faster way to compute `nchoosek` in MATLAB

我想找到一个比使用P = nchoosek(1:100,i)更快的代码,它位于一个循环中,并在我的代码中重复了i次。

nchoosek(1:100,10) is absolutely vast, far bigger than any typical machine could hold in memory.

The MATLAB documentation for nchoosek says

C = nchoosek(v,k) is only practical for situations where length(v) is less than about 15 .

You're not really going to be able to do this.

我发现VChoosek(v,k)nchoosek

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM