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
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 createn random steps consist of (1,0,-1). Than it will find the distance list at each random step, and max distance from origin in n random steps, and plot the step number to distance. For example: If my function name is w >>rw(10) create 10 random number include 1,0,-1 Steps as steps = Distance = 1 0 Max distance = 1 Graph as: -1 1 -1 0 0 -1 1 0 1 1 0 0 0 1 0 0 1 08 0.6 0.4 0.2 0 -0.2 -0.6 -0.8 10
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
