Question: (a) Write a MATLAB script RandomWalkC2D. The walker starts at the origin (xl,yl)-(0,0), and at each step takes a unit step (rstep-1) in a random


(a) Write a MATLAB script RandomWalkC2D. The walker starts at the origin (xl,yl)-(0,0), and at each step takes a unit step (rstep-1) in a random direction. Choose the direction of each step by randomly picking an angle 0e[0,21] using rand. Then k+1 kt1kTstep sin(Ox) Calculate the complete motion first, then animate the motion with another loop through time. Plot the position of the origin with a "+" sign and the position of the walker with a circle. At each time step in the animation loop, plot a line representing the path of the walker's entire history up to the current time. We are interested in seeing motion over hundreds or even thousands of steps
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
