Summation of Random Numbers

조회 수: 2 (최근 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 CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by