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: Geordie McBain
Subject: Re: Matlab date and time functions
Date: Tue, 04 Apr 2006 16:15:44 +1000

I believe datenum is in octave-forge rather than Octave proper, in which
case you'll need to install octave-forge to use datenum; see
http://octave.sf.net.  Installing octave-forge should also generally
ease the transition from Matlab.

On Tue, 2006-04-04 at 02:06 -0400, Samuel H. Dupree, Jr. 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]