Question: Matlab 2. A random walker is a simple idea: start at some point, and then every time, move in a random direction. In 1-D a

Matlab
2. A random walker is a simple idea: start at some point, and then every time, move in a random direction. In 1-D a random walker step to left or to right, or s/he can stop for a moment. If we are demonstrade step to right with 1, step to left with -1 and if s/he stop that we can demonstrade it with 0. In this question you will write a Matlab function, when user call that function as rw(n), it will create n random steps consist of (1,0,-1). Than it will find the distance list at each ramdom step, and max distance from origin in n random steps, and plot the step number to distance. For example: If my function name is rw >>rw(10) create 10 random number include 1,0,-1 1 - 1 0 1 0 -1 0 0 0 -1 -1 0 0 1 0 1 1 Steps as steps = 1 Distance = 1 0 Max distance = 1 Graph as: 0.8 0.6 0.4 0.2 0 -0.2 -0.4 -0.6 -0.8 -1 1 2 3 4 5 6 7 8 9 10
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
