Sir James the Wise is a brave and noble knight Each day he r

Sir James the Wise is a brave and noble knight. Each day he rides out with his sword, lance, and shining armour to seek adventure in the halls of the Mathematics Department. On each day there is a 5% probability that Sir James will rescue a princess, there is a 2% probability that Sir James will slay a dragon, and a 93% probability that he simply has a cup of tea and goes home again without rescuing a princess or slaying a dragon. Write a Matlab script file to estimate the probability that Sir James slays 5 or more dragons in one year. In any given week, what is the probability that Sir James has a cup of tea more often than he rescues a princess? (Write a Matlab script file to compute this.)

Solution

(a) -->solutions:

(a)Run MATLAB script

syntax: run(scriptname)

(b) edit

syntax: edit<filename>

Functions

Edit: edit or create file

input : request user input

x=input(prompt)

str= string(input,\'s\')

publish:generate view of MATLAB file in specified format

publish(file)

example

publish(file,format)

example

publish(file,Name,Value)

example

publish(file,options)

notebook:open MATLAB notebook in microsoft word software

syntax:

notebook
notebook(\'filename\')
notebook(\'-setup\')

snapnow:Force snapshot of image for inclusion in published document

 Sir James the Wise is a brave and noble knight. Each day he rides out with his sword, lance, and shining armour to seek adventure in the halls of the Mathemati

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site