我想找到一个比使用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 wherelength(v)
is less than about15
.
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.