bugGNU Octave - Bugs: bug #57533, Incorrect error message when...


bug #57533: Incorrect error message when assigning to a subset of a 3+ dimensional array

Submitted by:  Clint <terikin>
Submitted on:  Fri 03 Jan 2020 08:25:37 PM UTC  
Category:  Interpreter Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Other
Status:  Confirmed Assigned to:  None
Originator Name:  Clint 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.


  Spam posted by _174830
Sat 04 Jan 2020 12:11:37 AM UTC, comment #1: 

Confirmed.  Matlab, as well as Octave in the 2-D case, get it right.

This is probably something about reporting the dimensions of the original base matrix, rather than the dimensions of the object after indexing.  As an example of that,

octave:21> a = zeros (3,4,5);
octave:22> b = ones (2,2);
octave:23> a(1,:,2) = b
error: =: nonconformant arguments (op1 is 3x4x5, op2 is 2x2)

Rik <rik5>
Project Administrator
Fri 03 Jan 2020 08:25:37 PM UTC, original submission:  

When making an assignment to a subset of a higher-dimensional array, the error message can list incorrect dimensionality for op1.  The error message is correct when the matrix receiving the assignment has only two dimensions.

Example of code giving incorrect error:

a = zeros(2, 2, 1);
b = ones(2, 2);
a(1, :, 1) = b;
>> error: =: nonconformant arguments (op1 is 2x2x1, op2 is 2x2)

But it is readily apparent that op1 is actually 1x2x1.

In contrast, when a is 2x2:

a = zeros(2, 2);
b = ones(2, 2);
a(1, :) = b;
>> error: =: nonconformant arguments (op1 is 1x2, op2 is 2x2)

Here, the error message correctly reports the dimensionality of the subset of a that is being assigned to.

I've seen the same behavior in version 5.1.0 on Windows 10 and in version 4.2.2 on Ubuntu Linux.

Clint <terikin>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

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 terikin (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.




    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-01-08 mtmiller Carbon-CopyRemoved 174830 => -
    2020-01-04 rik5 Severity3 - Normal => 2 - Minor
        Item GroupNone => Other
        StatusNone => Confirmed
        Release5.1.0 => dev

    Back to the top

    Powered by Savane 3.5