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

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

[Octave-bug-tracker] [bug #64931] invalid dimension in delete_elements b


From: lp
Subject: [Octave-bug-tracker] [bug #64931] invalid dimension in delete_elements behaves oddly
Date: Sat, 25 Nov 2023 17:23:12 -0500 (EST)

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

                 Summary: invalid dimension in delete_elements behaves oddly
                   Group: GNU Octave
               Submitter: maglev
               Submitted: Sat 25 Nov 2023 10:23:10 PM UTC
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Unexpected Error or Warning
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: 8.4.0
         Discussion Lock: Any
        Operating System: Any
           Fixed Release: None
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Sat 25 Nov 2023 10:23:10 PM UTC By: lp <maglev>
I believe Octave *delete_elements* behaviour is inconsistent on its own, and
different from Matlab. If case A and B are accepted then why not case C?

A = zeros(5,3,2);
B = zeros(5,3,1);
C = zeros(5,3,1);

idx = [];

A(:,:,idx) = []; % Good
B(:,:,idx) = 1;  % Good
C(:,:,idx) = []; % error: invalid dimension in delete_elements.

% MATLAB computes "C(:,:,idx) = [];" without error and leaves C dimension 
unchanged. size(C) yields  5 3

I noticed a difference between Octave (8.4) and MATLAB 2023, also exact
version is likely not key. The code was tested with Octave on macos and linux,
and Matlab on macos. In my use case, idx is computed from mask operations and
it can be the empty set. The development is done with Matlab but deployment
with Octave. For the moment I added a test on idx to skip delete attempts if
idx is empty. Nevertheless, Octave is an amazing tool.








    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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