Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

matlab home work pls help me Create a Matlab script in an m-file which does all of the following. Name this file HW2.m. All commands

matlab home work pls help me
image text in transcribed
Create a Matlab script in an m-file which does all of the following. Name this file HW2.m. All commands should be followed by a semi-colon; so that when the script is run, nothing gets displayed to the screen. To receive full credit, you must use the exact variables names given below, and you must not have any terms getting printed to the screen. A random walk is represented by a vector beginning with 0 and where each subsequent entry in the vector is attained from the previous entry by adding a random choice of either 1 or -1. For example, a random walk might begin 0,-1,0,1,2,3,2,3,2,3,4,3,2,3,4,5). For this homework, our random walks will always continue until we reach an entry of absolute value 10. We will investigate how many steps it takes before we reach an entry of absolute value 10. Some of the questions below require you to use a function in Matlab which we haven't discussed yet. To find the names of these functions use the lookfor command. For example, to find the command for producing a histogram, try to type "lookfor histogram" in the command window. If that doesn't work, you can also do some googling 1. Make a vector "Y"containing the lengths of 5,000 different random walks, each of which ends when it reaches an entry of absolute value 10. (This is the main part of this homework.) 2. Define a variable "min" which is the minimum value in v. 3. Define a variable "max" which is the maximum value in v. 4. Define a variable mean" which is the mean value of the elements in v, rounded to the nearest integer. 5. Define a variable" median" which is the median value of the elements in v. 6. Plot a histogram of the elements in v

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_2

Step: 3

blur-text-image_3

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 Security XI Status And Prospects

Authors: T.Y. Lin, Shelly Qian

1st Edition

0412820900, 978-0412820908

More Books

Students also viewed these Databases questions

Question

What is a signal dictionary? Why is it important?

Answered: 1 week ago

Question

1. Identify an organization to analyze, preferably your employer.

Answered: 1 week ago

Question

What is electric dipole explain with example

Answered: 1 week ago

Question

What is polarization? Describe it with examples.

Answered: 1 week ago

Question

LO13.1 List the characteristics of monopolistic competition.

Answered: 1 week ago