Summation of Random Numbers

2 visualizaciones (últimos 30 días)
Alyx Kalleberg
Alyx Kalleberg el 13 de Oct. de 2019
Respondida: Walter Roberson el 13 de Oct. de 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.

Respuesta aceptada

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

Más respuestas (0)

Categorías

Más información sobre Mathematics en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by