More than 580 billion possibilities

3 visualizzazioni (ultimi 30 giorni)
asim nadeem
asim nadeem il 6 Set 2019
Commentato: asim nadeem il 8 Set 2019
Is it possible to check more than 580 billion possibilities in matlab without getting out of memory.

Risposta accettata

Matt J
Matt J il 6 Set 2019
Modificato: Matt J il 6 Set 2019
Sure, for example,
count=0;
for i=1:580*1e9
possibility=rand;
if possibility>0.5
count=count+1;
end
end

Più risposte (1)

Walter Roberson
Walter Roberson il 6 Set 2019
If you hold all of the possibilities in memory at the same time, and they take as little as 8 bytes each (that is, one double), then that would take over 4 1/4 terabytes. There are systems that can handle that much memory, so in theory you could do it, if you had the hardware.
There are some calculations that can be handled in "chunks" automatically by using "tall arrays"; see https://www.mathworks.com/help/matlab/tall-arrays.html

Categorie

Scopri di più su Get Started with MATLAB in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by