Creating Functions and Switch

1 view (last 30 days)
Rachel Reyes Reimon
Rachel Reyes Reimon on 23 Oct 2020
Commented: Walter Roberson on 23 Oct 2020
Write a script and a function that asks you to provide a month as an input for a given year (e.g. 2 or February for 2nd month of the specified year) and returns the number of days and number of hours in that particular month. Use the switch-construction. Be mindful about the exceptions such as leap years. Create the function separately for determining the number of the days and hours.

Answers (0)

Categories

Find more on Dates and Time 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!