Summation of Random Numbers

1 vue (au cours des 30 derniers jours)
Alyx Kalleberg
Alyx Kalleberg le 13 Oct 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.

Réponse acceptée

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

Plus de réponses (0)

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by