Summation of Random Numbers

1 回表示 (過去 30 日間)
Alyx Kalleberg
Alyx Kalleberg 2019 年 10 月 13 日
回答済み: Walter Roberson 2019 年 10 月 13 日
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.

採用された回答

Walter Roberson
Walter Roberson 2019 年 10 月 13 日
I would use a while loop.
while summation <= x
%add a random integer to the summation
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by