Problem

Develop an M-file function to determine the elapsed days in a year. The first line of the...

Develop an M-file function to determine the elapsed days in a year. The first line of the function should be set up as

function nd = days(mo, da, leap)

 where mo = the month (1-12), da = the day (1-31), and leap = (0 for non-leap year and 1 for leap year). Test it for January 1, 1999, February 29, 2000, March 1, 2001, June 21, 2002, and December 31, 2004. Hint: A nice way to do this combines the for and the switch structures.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 3