How can i save the time for calculating a combination (nchossek(1:10000,2)) ?thank you
Show older comments
How can i save the time for calculating a combination (nchoosek(1:10000,2)) ?thank you
6 Comments
Guillaume
on 6 Oct 2014
That's around 5e9 (5000 million!) different combinations! No matter what you do, it's going to take a while to compute.
Matt J
on 6 Oct 2014
And will require 40GB to store, assuming single floating point.
pengcheng
on 6 Oct 2014
Guillaume
on 6 Oct 2014
It's still 49e6 (49 million) combinations. You may want to rethink what you are doing (or be prepared to wait).
Note to check how many combinations that is:
nchoosek(10000, 2) %this value on the other is very fast to calculate
Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!