[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #45389] nd-array indexing with less subscripts
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #45389] nd-array indexing with less subscripts than dimensions |
Date: |
Wed, 24 Jun 2015 16:22:30 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:32.0) Gecko/20100101 Firefox/32.0 |
Follow-up Comment #1, bug #45389 (project octave):
Try
x(3,1,1) = 7
and the example works. I think Octave is accurate to throw an error since it
isn't clear with just x(3,1) whether you meant to index x(3,1,1) or x(3,1,2).
Matlab makes the assumption that you meant x(3,1,*1*), but not consistently
which makes the behavior even worse. I agree that x(1,9) would seem to imply
x(1,9,1) in Matlab but this fails. Rather than rely on weirdness in Matlab, I
would just re-code the m-file to be clear about what is desired. The re-coded
version will work in Matlab or Octave.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?45389>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/