help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Matlab date and time functions


From: Henry F. Mollet
Subject: Re: Matlab date and time functions
Date: Tue, 04 Apr 2006 19:23:06 -0700
User-agent: Microsoft-Entourage/11.1.0.040913

No problem here but I have octave-forge installed on
GNU Octave, version 2.1.71 (powerpc-apple-darwin8.1.0).
MacOS X 10.4.5
Henry

octave:1> help datenum
datenum is the user-defined function from the file
/usr/local/share/octave/2.1.71/site/m/octave-forge/time/datenum.m

 -- Function File:  datenum(Y, M, D [, h , m [, s]])
 -- Function File:  datenum('date' [, P])
     Returns the specified local time as a day number, with Jan 1, 0000
     being day 1. By this reckoning, Jan 1, 1970 is day number 719529.
     The fractional portion, corresponds to the portion of the specified
     day.

     Years can be negative and/or fractional.  Months below 1 are
     considered to be January.  Days of the month start at 1.  Days
     beyond the end of the month go into subsequent months.  Days before
     the beginning of the month go to the previous month.  Days can be
     fractional.

     XXX WARNING XXX this function does not attempt to handle Julian
     calendars so dates before Octave 15, 1582 are wrong by as much as
     eleven days.  Also be aware that only Roman Catholic countries
     adopted the calendar in 1582.  It took until 1924 for it to be
     adopted everywhere.  See the Wikipedia entry on the Gregorian
     calendar for more details.

     XXX WARNING XXX leap seconds are ignored.  A table of leap seconds
     is available on the Wikipedia entry for leap seconds.

     See also: date,clock,now,datestr,datevec,calendar,weekday.

Additional help for built-in functions, operators, and variables
is available in the on-line version of the manual.  Use the command
`help -i <topic>' to search the manual index.

Help and information about Octave is also available on the WWW
at http://www.octave.org and via the address@hidden
mailing list.

octave:2> datenum (2006,4,4)
ans = 732771
octave:3> 



on 4/3/06 11:06 PM, Samuel H. Dupree, Jr. at address@hidden wrote:

> I'm running Octave 2.1.71 on a Mac G5 under mac OS 10.4.5. I am
> attempting to run a program written in Matlab using Octave. The Matlab
> program running under Matlab works fine. My problem occurs when I'm
> running the program under Octave. The program abnormally terminates when
> it attempts to execute the function "datenum." The listing for the
> function where the error occurs follows:
> 
> *function [cdstr, utstr] = jd2str(jdate)
> 
> % convert Julian date to string equivalent
> % calendar date and universal time
> 
> % input
> 
> %  jdate = Julian date
> 
> % output
> 
> %  cdstr = calendar date string
> %  utstr = universal time string
> 
> % Orbital Mechanics with MATLAB
> 
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> 
> [month, day, year] = gdate(jdate);
> 
> % serial date number
> 
> sdn = datenum(year, month, day);
> 
> % create calendar date string
> 
> cdstr = datestr(sdn, 1);
> 
> % create universal time string
> 
> utstr = datestr(day - fix(day), 13);*
> 
> 
> The diagnostic message issued by Octave is:
> 
> 
> *error: `datenum' undefined near line 23 column 7
> error: evaluating assignment expression near line 23, column 5
> error: called from `jd2str' in file `/AstrodynamicsLib/ipto_de
> Folder/jd2str.m'
> error: near line 343 of file `/AstrodynamicsLib/ipto_de Folder/ipto_de.m'*
> 
>  From what I can tell, the arguments being passed to datenum seem okay,
> yet Octave reports that datenum is undefined. Any thoughts?
> 
> Thanks in advance.
> 
> Sam Dupree.
> 
> 




-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]