Write a script to compute the average number of integers over 1000 trails for different thresh holds

1 visualización (últimos 30 días)
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 comentario
Rik
Rik el 26 de Nov. de 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.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Clocks and Timers en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by