3 views (last 30 days)
Show older comments
Jorge Hernandez on 19 Apr 2021
Answered: Shivang Srivastava on 23 Apr 2021
Geoff Hayes on 19 Apr 2021
Edited: Geoff Hayes on 19 Apr 2021
Jorge - since this is homework, please discuss what you have attempted so far. If you have a specific question, then please ask it so that we can get a better idea of where you might be stuck.
Shivang Srivastava on 23 Apr 2021
I would recommend you try to solve the question yourself before going through the solution. Here is the solution for your reference:
function [output] = switchcaseWeekdays(n)
output = "Sunday";
output = "Monday";
output = "Tuesday";
output = "Wednesday";
output = "Thursday";
output = "Friday";
output = "Saturday";
output = "Not a valid input";
For more information do check the Switch Case Documentation.
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!