How can i save the time for calculating a combination (nchossek(1:10000,2)) ?thank you

How can i save the time for calculating a combination (nchoosek(1:10000,2)) ?thank you

6 Kommentare

That's around 5e9 (5000 million!) different combinations! No matter what you do, it's going to take a while to compute.
And will require 40GB to store, assuming single floating point.
if i want to calculer nchoosek(1:10000,2),do you have some advices to accelerate the calculation?
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
yes,i agree with you,that has a great combination,but these combinations are what i need,do you know other software or Parallel Computing Toolbox,like thses,can help me save time? thank you
I would encourage you to re-think your approach. You might want all combinations, but you probably don't need to store all of them. If so, it becomes an indexing problem.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Matrices and Arrays finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 6 Okt. 2014

Bearbeitet:

am 6 Okt. 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by