bugGNU Octave - Bugs: bug #33853, Incorrect element-wise vector...

 
 

bug #33853: Incorrect element-wise vector multiplication, with an unnamed vector

Submitted by:  None
Submitted on:  Mon 25 Jul 2011 08:43:58 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: InvalidAssigned to: None
Originator Name: SHKOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.2.4
Operating System: Microsoft Windows

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Mon 25 Jul 2011 09:24:08 AM UTC, comment #2:

Please have look at the operator precedence.

.* has a higher priority than the colon operator

so you actually computing (last example):

([1 0 0] .* 1):3

By the way matlab gives the same result:

>> [1 0 0] .* 1:3


ans =

1 2 3

>> [1 0 0] .* (1:3)


ans =

1 0 0

Kai Habel <kahacjde>
Project Member
Mon 25 Jul 2011 09:01:16 AM UTC, comment #1:

Simpler, more varied examples:

Anonymous
Mon 25 Jul 2011 08:43:58 AM UTC, original submission:

From the latest Octave-Forge build:

If the second vector is stored as a separate variable, the correct answer is produced:

Anonymous

 

(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 kahacjde (Posted a comment)
  •  

    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 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 25 Jul 2011 09:24:08 AM UTCkahacjdeStatusNone=>Invalid
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1