Write a script to compute the average number of integers over 1000 trails for different thresh holds
조회 수: 3 (최근 30일)
이전 댓글 표시
Write a script named random_walk that computes the average number of integers over 1000 trials for different thresholds, starting at 50, stepping by 10, and ending at 300. Your script should create a vector containing these averages. For example,
aveCounts = 1.0e+04 *
Columns 1 through 11
0.0077 0.0184 0.0330 0.0522 0.0746 0.1020 0.1355 0.1764 0.2248 0.2781 0.3424
Columns 12 through 22
0.4082 0.4870 0.5780 0.6816 0.7957 0.9165 1.0519 1.2062 1.3754 1.5493 1.7395
Columns 23 through 26
1.9444 2.1580 2.3984 2.6594
count=wander(thresh)
tot=0
for i=1000
count=randi([-10,10])
while abs(tot) <= thresh
tot=tot+randi([-10,10],1)
count=count+1
end
end
so im having problems getting the right output and then putting it into a vector
댓글 수: 1
Rik
2019년 11월 26일
The assignment is not clear enough for me to be able to help you. If you can further explain the assignment, I should be able to give you a hint.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Clocks and Timers에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!