bugGNU Octave - Bugs: bug #52001, error assigning to a slice of a 3d...

 
 

bug #52001: error assigning to a slice of a 3d matrix

Submitted by:  Carlo de Falco <cdf>
Submitted on:  Tue 12 Sep 2017 01:06:47 PM UTC  
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  dev Operating System:  Any

Add a New Comment (Rich Markup)
   

You are not logged in

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

 

Tue 12 Sep 2017 10:08:10 PM UTC, comment #2: 

Confirmed.  I can probably understand why as well.  Since the variable doesn't exist, all trailing dimensions are probably set to 1 so the implied size is 0x0x1.  The ':' indexing operator selects that last dimension, but it has size of one versus a size of three.  This squares with the error message issued

nonconformant arguments (op1 is 0x0x1, op2 is 2x3)

I'm guessing that this would be relatively hard to solve since it involves adding a very special corner case.

Rik <rik5>
Project Administrator
Tue 12 Sep 2017 01:53:50 PM UTC, comment #1: 

interesting.  it works (in 4.2.1) if you specify the 3rd range:

>> q(1,3:4,1:3) = ones(1, 2, 3)
q =
ans(:,:,1) =
     0     0     1     1

ans(:,:,2) =

     0     0     1     1

ans(:,:,3) =

     0     0     1     1

Nicholas Jankowski <nrjank>
Tue 12 Sep 2017 01:06:47 PM UTC, original submission:  

The following works in matlab (2016b):

>> clear all
>> q(1,3:4,:) = ones(1, 2, 3)

q(:,:,1) =

     0     0     1     1


q(:,:,2) =

     0     0     1     1


q(:,:,3) =

     0     0     1     1

while in Octave 4.3+ it produces an error

>> clear all
>> q(1,3:4,:) = ones(1, 2, 3)
error: =: nonconformant arguments (op1 is 0x0x1, op2 is 2x3)

Carlo de Falco <cdf>
Project Member

 

(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 rik5 (Posted a comment)
  • -email is unavailable- added by nrjank (Posted a comment)
  • -email is unavailable- added by cdf (Submitted the item)
  •  

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

    Only project members can vote.

     

     

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-09-12 rik5 StatusNone => Confirmed

    Back to the top


    Powered by Savane 3.5