{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Inlab05.pdf - In-Lab 5 User-Defined Functions Directions...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
1 In-Lab 5: User-Defined Functions Directions For this assignment, you will create an m-file as your main script. The file must have the following naming convention: “ FirstName_LastName_InLab5.m ”. Make sure to do the following for full credit: Create separate cells for each problem Comment your code thoroughly Suppress all unnecessary output Store all answers as variables To submit multiple files at once, zip them all together in MATLAB and rename using the above convention. Add the following header to every file you submit: % Name % Date % Section # % Assignment (i.e. In-Lab 1) Instructor-Guided Portion (download InLab5.m from the Moodle page) 1. Write a function rollDice(n) that returns the result of rolling two n-sided dice. Each roll result should be stored in its own variable. For example, [d1, d2] = rollDice(6) could return d1 = 3 and d2 = 6. 2. Write a function plotFormatting() that has no inputs, but will ask the user for a color (‘red’, ‘blue’, or ‘green’) and for a plot style (circle or star). It will then output a string saved
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}