Write a script to compute the average number of integers over 1000 trails for different thresh holds
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentar
Rik
am 26 Nov. 2019
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.
Antworten (0)
Siehe auch
Kategorien
Mehr zu Clocks and Timers finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!