Make a function, called hmwk5.m, to convert the month from a number to a string. It should
Question:
Make a function, called "hmwk5.m", to convert the month from a number to a string. It should have one input, an integer value, that specifies the month, i.e. 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, or 12. It should return one output, a string, i.e. January, February, March, April, ..., or December. Use a "switch" statement to choose the output string. Note that the function should normally not print anything, unless the input is a value not listed above. In that case, it should print a message using the "error" command.
Like earlier assignments, use the "type" command and several test cases to show that your function works. Turn in a copy of the interaction, i.e. copy from the MATLAB command window, or use the diary command.
Example: >> monthname = hmwk5(1); >> disp(sprintf(' The month is %s.', monthname)); The month is January.