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

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

[Octave-bug-tracker] [bug #65008] ind2sub with indices lower than 0


From: anonymous
Subject: [Octave-bug-tracker] [bug #65008] ind2sub with indices lower than 0
Date: Mon, 11 Dec 2023 05:23:31 -0500 (EST)

URL:
  <https://savannah.gnu.org/bugs/?65008>

                 Summary: ind2sub with indices lower than 0
                   Group: GNU Octave
               Submitter: None
               Submitted: Mon 11 Dec 2023 10:23:29 AM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: None
             Assigned to: None
         Originator Name: Guillaume
        Originator Email: 
             Open/Closed: Open
                 Release: dev
         Discussion Lock: Any
        Operating System: Any
           Fixed Release: None
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Mon 11 Dec 2023 10:23:29 AM UTC By: Anonymous
In Matlab, indices in ind2sub are not restricted to be strictly greater than
0:


[x,y] = ind2sub([32 32], 0)
x =
     0
y =
     1


Octave complains:


[x,y] = ind2sub([32 32], 0)
error: ind2sub: invalid index index 0: subscripts must be either integers 1 to
(2^63)-1 or logicals


This is what Matlab returns more generally:


[x,y] = ind2sub([32 32], -3:3) 
x =
    -3    -2    -1     0     1     2     3
y =
     1     1     1     1     1     1     1









    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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