Question: This program is in Matlab. Objectives (This program absolutely must have): *Build and work with arrays *Use a logical vector for masking *Create a 2D

This program is in Matlab.

Objectives (This program absolutely must have):

*Build and work with arrays

*Use a logical vector for masking

*Create a 2D plot of Vector data

Background:

A markov process is a memoryless process, which means the future state of the system is independent of its history, and depends only on its state. Pure gambling is an example of a Markov process. Whether you win or lose a particular round should not depend on your history.

Assignment:

Write a matlab function called lab11.m that will determine the probability of a markov process given an initial state. Specifically, the function will determine whether a nearly blind person will end up at home or the local pub. There are six intersections between home and the pub, and the person will move towards the pub with 2/3 probability and towards home with 1/3 probability. They continue to move either direction until arriving at either home or the pub. The function will also generate a plot of the movement history of the person. Home is location 1 and the pub is location 8 in this plot shown below.

Your function must be implemented using arrays and array functions. The input to the function is an array of arbitrary length ( DO NOT HARD CODE THE 6 INTERSECTIONS)

It must accept a logical array of arbitrary lengh

Output "PUB" or "HOME"

Create a plot of the movement history

Sample output:

>>lab11([0 0 1 0 0 0])

PUB (graph will also display of the movement history)

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!