From octave-sources-request at bevo dot che dot wisc dot edu Mon Jan 27 14:10:31 2003 Subject: yeardays.m From: Stefan Burger To: octave-sources at bevo dot che dot wisc dot edu Date: Mon, 27 Jan 2003 08:13:24 -0600 --------------Boundary-00=_R7MD01WXHU1772IPRZ6J Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable --------------Boundary-00=_R7MD01WXHU1772IPRZ6J Content-Type: text/plain; charset="us-ascii"; name="yeardays.m" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="yeardays.m" ## Copyright (C) 2003 Stefan Burger ## ## This file is part of Octave. ## ## Octave is free software; you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by the ## Free Software Foundation; either version 2, or (at your option) any ## later version. ## ## Octave is distributed in the hope that it will be useful, but WITHOUT ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ## for more details. ## ## You should have received a copy of the GNU General Public License ## along with Octave; see the file COPYING. If not, write to the Free ## Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. ## -*- texinfo -*- ## at deftypefn {Function File} {} yeardays (@var{Year}) ## Returns number of days (365, 366) for a given at var{Year} dot ## Enter Year as a 4 digit number, e.g., 2003. If no input is specified, the function ## defaults to the current year. Yeardays() uses is_leap_year() internally. ## ## at end deftypefn ## at seealso{year and is_leap_year.) ## Author: Stefan Burger ## Description: Returns number of days in a year. function Days = yeardays (Year) if (nargin < 1) Year = year(); %% If no value specified, use current year. %% see year(). endif Days = is_leap_year(Year) +365; endfunction --------------Boundary-00=_R7MD01WXHU1772IPRZ6J--