Question: 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.

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 ? [0.2?] using rand. Then Xk +1 = Xk + rstep cos(%) Yk+1 Vk 'step sin(Ok.) Calculate the complete motion first, then animate the motion with another loop througlh 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
