Question: Write a MATLAB script that generates the following 1 D random walk ( 1 0 0 steps ) : each time the position of the

Write a MATLAB script that generates the following 1D random walk (100 steps): each time the position of the marker changes by -1,0, or 1. The marker starts its walk at x =15.
Write a script to answer the following questions:
What is the final location of the marker (assign the result to x)?
What is the total distance travelled by the marker (assign the result to d)?
Hint: consider using a built-in function called abs for finding the absolute value and thus the travelled distance.

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!