Part 3: MATLAB: Programming Questions (30/100)
For the following question you must document you programs properly. 10% of t
mark is allocated for comments. Proper documentation would consist of
program description and detail of every component of the program
(14) (10 marks) Write a MATLAB script to do the following:
1) The user is prompted to enter one of the following characters: 'N', 'R' or 'S'.
2) Using MATLAB's length function, the program first checks if the entered data is
a single character; if it is not the program display an error message to the user and
ends.
3) Using the switch/case structure, if the data is a single character it will display
the following:
a. If the character is an 'N', then display the message 'It is a nice day!'
b. If the character is a 'R' then display the message 'It is raining today!'
c. If the character is a 'S', then display the message 'It is snowing today!'
d. For any other single character, display 'That was not a valid choice';
(15) (10 marks) For the following array