Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Write a 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; d should be a regular variable and not a vector)?
Hint: consider using a built-in function called abs for finding the absolute value and thus the travelled distance.
Script 0
Save
C Reset
MATLAB Documentation
x_1=15;
d_1=0;
total_steps =100;
k_1=-1;
N=3;
k_N=1
i_1=randi(N)
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students also viewed these Databases questions

Question

Question How are IRAs treated for state tax law purposes?

Answered: 1 week ago