...
Code Block | ||
---|---|---|
| ||
function days = daysInMonth(monthNumber) switch ( monthNumber ) case {1, 3, 5, 7, 8, 10, 12} days = 31; case {4, 6, 9, 11} days = 30; case 2 days = 28; otherwise days = 0; end end |
...
...
Code Block | ||
---|---|---|
| ||
function days = daysInMonth(monthNumber) switch ( monthNumber ) case {1, 3, 5, 7, 8, 10, 12} days = 31; case {4, 6, 9, 11} days = 30; case 2 days = 28; otherwise days = 0; end end |
...