bugGNU Octave - Bugs: bug #51196, plus, +, minus, - on column vs row...

 
 

bug #51196: plus, +, minus, - on column vs row vectors should fail but returns matrix

Submitted by:  Doug McLelland <weedoug>
Submitted on:  Wed 07 Jun 2017 08:51:35 AM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Missed Error or Warning
Status: DuplicateAssigned to: None
Originator Name: Open/Closed: Closed
Release: 4.2.1Operating System: Microsoft Windows

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 07 Jun 2017 10:21:41 AM UTC, comment #1:

Hi,

This is called broadcasting and is actually intensional. This used to be an Octave extension but AFAIU the most recent versions of Matlab do the same.

There used to be a warning (which could be turned into an error) when this extension was used but it has been removed. See bug #45761 .

Closing report as duplicate.

Pantxo Diribarne <pantxo>
Project Member
Wed 07 Jun 2017 08:51:35 AM UTC, original submission:

When adding or subtracting a pair of vectors, one column, one row, I expect them to return an error of unequal size (as Matlab does), or at a push, to reshape and add if the vectors are of equal length. Instead I get:

In this example, the vectors are of equal length, but a similar result is obtained for unequal vectors.

I think this is very unlikely to be intentional? And dangerous, since it can go completely unnoticed and result in serious errors if you then go on to use the output referring by index.

Doug McLelland <weedoug>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by pantxo (Posted a comment)
  • -unavailable- added by weedoug (Submitted the item)
  • -unavailable- added by weedoug
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 07 Jun 2017 10:21:41 AM UTCpantxoStatusNone=>Duplicate
      Open/ClosedOpen=>Closed
    Wed 07 Jun 2017 08:51:35 AM UTCweedougCarbon-Copy-=>Added weedoug

    Back to the top


    Powered by Savane 3.1-cleanup1