bugGNU Octave - Bugs: bug #61351, incorrect result of nonconformant...

 
 

bug #61351: incorrect result of nonconformant vector

Submitter:  None
Submitted:  Tue 19 Oct 2021 06:09:38 AM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 6.3.0
Operating System:  * Microsoft Windows Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 19 Oct 2021 02:22:08 PM UTC, comment #4: 

Thought it worth noting that the Matlab version number mentioned by the original poster (2016a), is the last version of Matlab that did not include implicit broadcastig.  In the very next release Matlab changed the arithmetic behavior to include implicit expansion for . operators (what Octave for years sometimes called automatic broadcasting), rather that requiring use of the 'bsxfun' function. 

https://www.mathworks.com/help/matlab/release-notes.html?rntext=implicit&startrelease=R2016b&endrelease=R2016b&groupby=release&sortby=descending&searchHighlight=implicit

So the incompatibility the OP is reporting is between Matlab versions, not with Octave.

Nicholas Jankowski <nrjank>
Group Member
Tue 19 Oct 2021 08:40:46 AM UTC, comment #3: 

Octave and newer versions of Matlab use a technique called "broadcasting":
https://octave.org/doc/v6.3.0/Broadcasting.html#Broadcasting

Since many functions in Octave's code base rely on that technique, it is not possible to de-activate it.

Closing as invalid.

Markus Mützel <mmuetzel>
Group administrator
Tue 19 Oct 2021 08:34:43 AM UTC, comment #2: 

Sent via private email:

> As in Matlab R2016a, I expect an error.
>
> >> v= [ 1 2 3] .* [ 3 4 5 ]'
> Matrix dimensions must agree.
>
> >> v= [ 1 2 3] + [ 3 4 5 ]'
> Matrix dimensions must agree.


Please, use the web form on the bug tracker when responding to this report so that others can follow, too. Savannah doesn't pick up answers sent by email.

Markus Mützel <mmuetzel>
Group administrator
Tue 19 Oct 2021 06:56:13 AM UTC, comment #1: 

Results for the commands in Matlab R2021a:

>> v= [ 1 2 3] .* [ 3 4 5 ]'
v= [ 1 2 3] + [ 3 4 5 ]'
v= [ 1 2 3] ./ [ 3 4 5 ]'
v= [ 1 2 3] - [ 3 4 5 ]'

v =

     3     6     9
     4     8    12
     5    10    15


v =

     4     5     6
     5     6     7
     6     7     8


v =

    0.3333    0.6667    1.0000
    0.2500    0.5000    0.7500
    0.2000    0.4000    0.6000


v =

    -2    -1     0
    -3    -2    -1
    -4    -3    -2


In Octave 6.3.0:

>> v= [ 1 2 3] .* [ 3 4 5 ]'
v =

    3    6    9
    4    8   12
    5   10   15

>> v= [ 1 2 3] + [ 3 4 5 ]'
v =

   4   5   6
   5   6   7
   6   7   8

>> v= [ 1 2 3] ./ [ 3 4 5 ]'
v =

   0.3333   0.6667   1.0000
   0.2500   0.5000   0.7500
   0.2000   0.4000   0.6000

>> v= [ 1 2 3] - [ 3 4 5 ]'
v =

  -2  -1   0
  -3  -2  -1
  -4  -3  -2


That looks the same to me.

Which result did you get and which result did you expect?

Markus Mützel <mmuetzel>
Group administrator
Tue 19 Oct 2021 06:09:38 AM UTC, original submission:  

% wrong results
v= [ 1 2 3] .* [ 3 4 5 ]'
v= [ 1 2 3] + [ 3 4 5 ]'
v= [ 1 2 3] ./ [ 3 4 5 ]'
v= [ 1 2 3] - [ 3 4 5 ]'

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 nrjank (Posted a comment)
  • -email is unavailable- added by mmuetzel (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-10-19 mmuetzel StatusNeed Info Invalid / Not an Octave Bug
        Open/ClosedOpen Closed
    2021-10-19 mmuetzel StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-aa77.
    Corresponding source code