bugGNU Octave - Bugs: bug #47510, arrayfun errors on indexing...


bug #47510: arrayfun errors on indexing diagonal matrix

Submitted by:  CarnĂ« Draug <carandraug>
Submitted on:  Wed 23 Mar 2016 05:23:03 PM UTC  
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: ConfirmedAssigned to: None
Originator Name: Open/Closed: Open
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)

You are not logged in

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


Thu 24 Mar 2016 04:33:10 AM UTC, comment #4:

Actually, I see your point. I must have been mistaken in my test script.

Rik <rik5>
Project Administrator
Thu 24 Mar 2016 04:05:26 AM UTC, comment #3:

I think my original suggestion is correct, at least it works for me without sub2ind.

From the specification, only one column in each row has a 1 in it. Therefore I created indices (i,j) where i runs over the rows (1:N) and the j index is provided by the vector Y.

Rik <rik5>
Project Administrator
Thu 24 Mar 2016 02:50:24 AM UTC, comment #2:

@Rik: I think you meant:

not that it matters here :)

Amro <amro_octave>
Wed 23 Mar 2016 08:34:25 PM UTC, comment #1:

Confirmed, although the code is really poorly written to do the job stated by the author on StackOverflow. I think the code below is clearer.

To help narrow it down, it is possible to index diagonal arrays either on the command line or in a function (m-file). A little use of grep shows that the message "can't perform indexing operations" is only in libinterp/octave-value/ov-base.cc for either subsref or do_index_op.

I set some breakpoints and tried the code and I got the following backtrace.

Rik <rik5>
Project Administrator
Wed 23 Mar 2016 05:23:03 PM UTC, original submission:

Reported on stackoverflow https://stackoverflow.com/questions/36182328/why-this-octave-code-wont-work

Carnë Draug <carandraug>
Project Member


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

Attach File(s):

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 amro_octave (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by carandraug (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):



    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 23 Mar 2016 08:34:25 PM UTCrik5StatusNone=>Confirmed

    Back to the top

    Powered by Savane 3.1-cleanup1