Summation of Random Numbers

2 visualizzazioni (ultimi 30 giorni)
Alyx Kalleberg
Alyx Kalleberg il 13 Ott 2019
Risposto: Walter Roberson il 13 Ott 2019
How would you go about writing a code to solve a summations of randomly generated intergers, say r= to an equation, until the sum is greater than a number, say x.

Risposta accettata

Walter Roberson
Walter Roberson il 13 Ott 2019
I would use a while loop.
while summation <= x
%add a random integer to the summation
end

Più risposte (0)

Categorie

Scopri di più su Mathematics in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by