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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!