bugGNU Octave - Bugs: bug #52489, Incorrect Result when adding 2...

 
 

bug #52489: Incorrect Result when adding 2 matrices with different dimensions

Submitter:  None
Submitted:  Thu 23 Nov 2017 05:45:09 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  THH Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 4.2.1
Operating System:  * Microsoft Windows Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 23 Nov 2017 06:25:24 PM UTC, comment #2: 

This is correct behavior.  See the documentation on Broadcasting (https://www.gnu.org/software/octave/doc/interpreter/Broadcasting.html).  Both Python and Octave do broadcasting, and recent versions of Matlab have followed this behavior and do it as well.

Rik <rik5>
Group administrator
Thu 23 Nov 2017 06:05:02 PM UTC, comment #1: 
Jordi GutiƩrrez Hermoso <jordigh>
Group Member
Thu 23 Nov 2017 05:45:09 PM UTC, original submission:  


>> a = [1;2;3;4]

a =

   1
   2
   3
   4

>> b = [1,2,3,4]

b =

   1   2   3   4

>> c = a + b

c =

   2   3   4   5
   3   4   5   6
   4   5   6   7
   5   6   7   8

Anonymous

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

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 jordigh (Posted a comment)
  • -email is unavailable- added by None (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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-11-23 jordigh StatusNone Invalid / Not an Octave Bug
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code