Summation of Random Numbers

2 Ansichten (letzte 30 Tage)
Alyx Kalleberg
Alyx Kalleberg am 13 Okt. 2019
Beantwortet: Walter Roberson am 13 Okt. 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.

Akzeptierte Antwort

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

Weitere Antworten (0)

Kategorien

Mehr zu Mathematics finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by