datenum with fractional months

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

datenum with fractional months

David Bateman-2
Looking at the bug #36482 it seems that the issue is that datetick is
calling datenum with a fractional month, which is not currently allowed
with Octave's datenum function. However the fix could either go into
datetick or datenum. I suppose it would be best to follow what matlab
does in this case. Could someone with access to matlab tell me what

datenum(2012,5.5)
datenum(2012,5.5,15)

give?

Thanks
David

Reply | Threaded
Open this post in threaded view
|

Re: datenum with fractional months

bpabbott
Administrator
On May 20, 2012, at 3:28 PM, David Bateman wrote:

> Looking at the bug #36482 it seems that the issue is that datetick is
> calling datenum with a fractional month, which is not currently allowed
> with Octave's datenum function. However the fix could either go into
> datetick or datenum. I suppose it would be best to follow what matlab
> does in this case. Could someone with access to matlab tell me what
>
> datenum(2012,5.5)
> datenum(2012,5.5,15)
>
> give?
>
> Thanks
> David
>

datenum (2012, 5.5)

Warning: Unless the first input argument is a date string, all subsequent
arguments will be ignored.
> In datevec at 69
  In datenum at 118

ans =

        2012

datenum (2012, 5.5, 15)

ans =

      735004

Ben
Reply | Threaded
Open this post in threaded view
|

Re: datenum with fractional months

David Bateman-2
On 05/20/2012 11:35 PM, Ben Abbott wrote:

> On May 20, 2012, at 3:28 PM, David Bateman wrote:
>
>> Looking at the bug #36482 it seems that the issue is that datetick is
>> calling datenum with a fractional month, which is not currently allowed
>> with Octave's datenum function. However the fix could either go into
>> datetick or datenum. I suppose it would be best to follow what matlab
>> does in this case. Could someone with access to matlab tell me what
>>
>> datenum(2012,5.5)
>> datenum(2012,5.5,15)
>>
>> give?
>>
>> Thanks
>> David
>>
> datenum (2012, 5.5)
>
> Warning: Unless the first input argument is a date string, all subsequent
> arguments will be ignored.
>> In datevec at 69
>   In datenum at 118
>
> ans =
>
>         2012
>
> datenum (2012, 5.5, 15)
>
> ans =
>
>       735004
>
> Ben
>
>

Thanks Ben, it seems that matlab's datenum accepts fractional months, so
the fix for #36482 should be in datenum

D.