bugGNU Octave - Bugs: bug #42334, datevec() output should have the...

 
 

bug #42334: datevec() output should have the same size as its input in case of datenum

Submitter:  sergey plotnikov <nul0m>
Submitted:  Sun 11 May 2014 07:10:55 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 3.8.1 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 12 May 2014 02:59:58 PM UTC, comment #3: 

Yes, thanks for catching that.  I checked in a fix for that (http://hg.savannah.gnu.org/hgweb/octave/rev/38925538ec14).

Rik <rik5>
Group administrator
Mon 12 May 2014 12:33:55 PM UTC, comment #2: 

Hm.. I believe there's a typo in the cset you've pushed. We should record the size of input if it is not a COLUMN vector.

sergey plotnikov <nul0m>
Mon 12 May 2014 12:17:03 AM UTC, comment #1: 

I committed your patch with the addition of some input validation tests here: http://hg.savannah.gnu.org/hgweb/octave/rev/9eb72fa5f8b5.  The fix was made on the development branch which will be released as version 4.2.  You can build from Mercurial sources if you need the fix sooner.  Thanks for contributing.

Rik <rik5>
Group administrator
Sun 11 May 2014 07:10:55 PM UTC, original submission:  

When input of datevec() function is datenum and nargout is greater than one all the output vectors should have the same size as input date. Below are the results comparing Matlab and Octave.


>> [~,~,d] = datevec([1 2; 3 4]) % Octave
d =

   1
   3
   2
   4
-----------------------------------------
>> [~,~,d] = datevec([1 2; 3 4]) % Matlab
d =
     1     2
     3     4


I hope the following patch would be a decent solution.

sergey plotnikov <nul0m>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #31358:  datevec_size.patch added by nul0m (812B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by nul0m (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-05-12 rik5 CategoryNone Octave Function
        StatusNone Fixed
        Open/ClosedOpen Closed
    2014-05-11 nul0m Attached File- Added datevec_size.patch, #31358

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code