bugGNU Octave - Bugs: bug #36066, number/array fails

 
 

bug #36066: number/array fails

Submitted by:  Kris Thielemans <krthie>
Submitted on:  Mon 02 Apr 2012 01:40:29 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: Wont FixAssigned to: None
Originator Name: Kris ThielemansOpen/Closed: Closed
Release: 3.6.1Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Mon 02 Apr 2012 06:41:38 PM UTC, comment #3:

So it appears that this really is some aberrant Matlab behaviour. We just tried on a 3.4.1 build, and 1/rand(2,4,3) also errors out.

This looks like a Matlab bug to me, and I don't think we should reproduce it in Octave. I'll mark this bug Won't Fix. If you disagree, we can reconsider this.

Jordi GutiƩrrez Hermoso <jordigh>
Project Administrator
Mon 02 Apr 2012 01:53:41 PM UTC, comment #2:

oh well. I find the following in matlab 2011b

>> 1/ones([3 2])

Error using /
Matrix dimensions must agree.

>> 1/ones([3 2 2])


ans(:,:,1) =

1 1
1 1
1 1

ans(:,:,2) =

1 1
1 1
1 1

That is, you need an nd array... I'm 100% sure that this has worked in matlab since 2006a.

Kris Thielemans <krthie>
Mon 02 Apr 2012 01:48:52 PM UTC, comment #1:

Are you sure this works in Matlab? I just heard from two sources that it doesn't and errors out (or "crashes", in your language) in the same way that it errors out in Octave.

Jordi GutiƩrrez Hermoso <jordigh>
Project Administrator
Mon 02 Apr 2012 01:40:29 PM UTC, original submission:

I've just upgraded to octave 3.6.1 and find that dividing a number by an array no longer works (it did in 3.4.1):

octave> tmp2=1/ones([3 4 5]);
error: invalid conversion of NDArray to Matrix
octave> tmp2=1/ones([3 4]);
error: operator /: nonconformant arguments (op1 is 1x1, op2 is 3x4)

this does work in matlab though, so my old programs now crash. I wonder if this is unintended behaviour though as this stuff does work with the other operators + - *, for instance

octave> tmp2=1*ones([3 4 5]);

(it doesn't work with ^, but neither does it in matlab)

octave> tmp2=1./ones([3 4 5]);

does still work of course.

Kris Thielemans <krthie>

 

(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 jordigh (Posted a comment)
  • -unavailable- added by krthie (Submitted the item)
  •  

    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 02 Apr 2012 06:41:38 PM UTCjordighStatusNone=>Wont Fix
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1