octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #62405] Out of Bound(OOB) on subsindex()


From: Glite
Subject: [Octave-bug-tracker] [bug #62405] Out of Bound(OOB) on subsindex()
Date: Tue, 3 May 2022 06:45:56 -0400 (EDT)

Follow-up Comment #2, bug #62405 (project octave):

I give a comparison between mat calculation and the result I expect on
subsindex():

  If i want to get the 1:2 index of [1 2 3 4], I can write this code:
>> a=[1 2 3 4]

a =

     1     2     3     4

>> a(1:2)

ans =

     1     2

On subsindex() I should get the same result by:

>> input_container = InputContainer([1 2 3 4]);
InputContainer class initialized.
>> b = 1:2;
>> b(input_container)

But subsindex() throws an error. That's the bug.


[comment #1 comment #1:]
> Maybe, I'm missing the point. Could you please elaborate what you think is
the bug?
> 
> What does `subsindex(input_container)` return in your example. IIUC, it
returns `[0 1 2 3]`. `b` in your last example has only two elements. So,
indexing it with effectively `b([0 1 2 3]+1)` leads to the error you are
seeing.
> 


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?62405>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]