Question: Part 3: MATLAB: Programming Questions (25/100) (15) (5 marks) Which of the following are keywords: 1. (1 mark) end 2. (1 mark) iE 3. (1
Part 3: MATLAB: Programming Questions (25/100) (15) (5 marks) Which of the following are keywords: 1. (1 mark) end 2. (1 mark) iE 3. (1 mark) then 4. (1 mark) Lakeyword 5. (1 mark) else For the following two questions you must document you programs properly. 10% of the mark is allocated for comments. Comment should include a brief descripon at the top of the program stating what the program does. (16) (10 marks) Write a MATLAB script to do the following 1) The following infomation is displayed on the computer screen and the user s prompted to make a menu selection Make a selection for the following: Select 1 to play a game Select 2 to continue a previous gane. Seloct 3 to exit Enter your selection: 2) Using the switch/case structure, the following will be displayed: a. If '1' is selected, display Play gamer b. If 2 is selected, display 'Continue a previous game! c. If 3' is selected, display Bye, bye! d. For any other value, display Section not valid. Bye, bye (17) (10 marks) Write an M-file that will first define an array as A [2, 3, 4, 5, 6] Using a for loop, calculate the product of the elements. Use the MATLAB function length to define the size of the array in the for loop indexing variable
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
