bugGNU Octave - Bugs: bug #63733, Matlab incompatibility for certain...


bug #63733: Matlab incompatibility for certain corner case indexing operations

Submitter:  Rik <rik5>
Submitted:  Mon 30 Jan 2023 07:56:01 PM UTC
Category:  Interpreter Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Mon 30 Jan 2023 07:56:01 PM UTC, original submission:  

Here are a few incompatibilities for indexing between Matlab and Octave


z = zeros (5,0);
z(3) = 1;

Octave throws an error, while Matlab results in a 1x3 vector.  Interestingly, Octave gets the same result as Matlab (1x3 vector) if "z = zeros (0, 5)" (see also example below where column index of 1 seems to be special).


z = zeros (0,1);
z(3) = 1;
size (z)

Octave returns a row vector ([1, 3]) while Matlab returns a column vector ([3, 1]) for this case.


z = zeros (1,2,3,4);
z(5,2) = 1;
size (z)

Octave throws an error, while Matlab returns [5,2,3,4].


z = zeros (1,1,3);
z(5) = 1;
size (z)

Octave throws an error, while Matlab returns [1,1,5].

Rik <rik5>
Group administrator


(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 (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.


    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-ee12.
    Corresponding source code