bugGNU Octave - Bugs: bug #48523, 3d meshgrid incorrect

 
 

bug #48523: 3d meshgrid incorrect

Submitter:  Muhali <muhali>
Submitted:  Fri 15 Jul 2016 04:06:18 PM UTC
   
 
Category:  Octave Function Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 13 Sep 2017 04:21:20 AM UTC, comment #4: 

@Markus: Finally got around to reviewing and pushing your patch here http://hg.savannah.gnu.org/hgweb/octave/rev/631076eab47b.  Thanks for the work, and sorry no one noticed this easy fix earlier.

Rik <rik5>
Group administrator
Mon 19 Dec 2016 05:34:25 PM UTC, comment #3: 

Can this patch be considered for pushing?

It looks like I accidently uploaded the same file twice. They are both identical.

Markus Mützel <mmuetzel>
Group administrator
Tue 26 Jul 2016 02:05:31 PM UTC, comment #2: 

Attached please find the trivial fix. It also adds a test for the case from comment #0.

In contrast to Matlab, Octave allows nargin==2 with nargout==3. This adds functionality and imho does not break compatibilty. I documented this specific case. OK?

(file #38030)

Markus Mützel <mmuetzel>
Group administrator
Fri 15 Jul 2016 04:18:08 PM UTC, comment #1: 

Thanks. This should be an easy fix in the meshgrid.m file.

This does work if nargout == 3, but Octave is using nargout to determine whether the space should be 2 or 3 dimensions and ignoring the 3rd input argument if nargout < 3.


>> x = meshgrid(1:2, 1:3, 1:5); size (x)
ans =

   3   2

>> [x,~,~] = meshgrid(1:2, 1:3, 1:5); size (x)
ans =

   3   2   5


If nargin == 1, then the results should still be based on nargout as it is done currently, but if nargin > 1 then the output should probably be derived from that.

Mike Miller <mtmiller>
Group Member
Fri 15 Jul 2016 04:06:18 PM UTC, original submission:  


x = meshgrid(1:2, 1:3, 1:5) ;
size(x)


incorrectly produces

ans =

   3   2

whereas the correct should be (as in ML)

ans =

     3     2     5

Muhali <muhali>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #38045:  bug48523_meshgrid.patch added by mmuetzel (2KiB - text/x-diff)
file #38030:  bug48523_meshgrid.patch added by mmuetzel (2KiB - text/x-diff)

 

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 mmuetzel (Updated the item)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by muhali (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 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-09-13 rik5 StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2016-12-19 mmuetzel StatusConfirmed Patch Submitted
    2016-07-28 mmuetzel Attached File- Added bug48523_meshgrid.patch, #38045
    2016-07-26 mmuetzel Attached File- Added bug48523_meshgrid.patch, #38030
    2016-07-15 mtmiller Severity3 - Normal 2 - Minor
        Item GroupNone Matlab Compatibility
        StatusNone Confirmed
        Release4.0.2 dev
        Operating SystemGNU/Linux Any

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code