I'm doing part 3 of this assignment. I got the thing to work. But i can't get the walker to bounce back. My for loop for that doesn't seem to work. Any advice?
iterations = 1;Num_steps = 1000;Random_steps_r = NaN(Num_steps,iterations);for i = 1:iterationsRandom_steps_r(:,i) = cumsum(-1 + 2 * round(rand(Num_steps,1)),1);endx=Random_steps_r;if Random_steps_r>=10x=9;elseif Random_steps_r<=-10x=-9;endcomet(x)
The part that doesn't work is the last forloop.