bugGNU Octave - Bugs: bug #52086, t=1:5; t(zeros(0,1)+[1:2]) returns...

 
 

bug #52086: t=1:5; t(zeros(0,1)+[1:2]) returns 0×2 empty double matrix in Matlab

Submitted by:  Alois Schlögl <schloegl>
Submitted on:  Fri 22 Sep 2017 06:37:02 AM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: Works For MeAssigned to: None
Originator Name: Open/Closed: Closed
Release: 4.2.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.

 

Sat 23 Sep 2017 12:12:23 AM UTC, comment #2:

This works for me too.

I get the quoted error message in Octave 4.0.3

but this is fixed in 4.2.1.

Mike Miller <mtmiller>
Project Administrator
Fri 22 Sep 2017 03:57:47 PM UTC, comment #1:

This works for me. Octave-4.2.1, started with '-f' flag to prevent any user initialization files from possibly screwing things up.

Also works on the development branch of Octave. System is Linux.

Rik <rik5>
Project Administrator
Fri 22 Sep 2017 06:37:02 AM UTC, original submission:

Recently, I tried to convert some Matlab code to Octave. In Matlab 9.1.0.441655 (R2016b), this expression returned

In Octave 4.2.1 the expression fails with this error

Matlab R2013a fails with this error

If it is a 0x0 or 1x1, like this
the expression fails in Matlab R2016b as well.

In the present case, the empty matrix zeros(0,1) was the result of "find(..)", and under special conditions it can support writing leaner code. One could argue whether this needs fixing, but Octave should be aware of this.

Best,
Alois

Alois Schlögl <schloegl>

 

(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 mtmiller (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by schloegl (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
    Sat 23 Sep 2017 12:12:23 AM UTCmtmillerOpen/ClosedOpen=>Closed
    Fri 22 Sep 2017 03:57:47 PM UTCrik5StatusNone=>Works For Me

    Back to the top


    Powered by Savane 3.1-cleanup1