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

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

[Octave-bug-tracker] [bug #65228] matlab for loops on empty row vector


From: A.R. Burgers
Subject: [Octave-bug-tracker] [bug #65228] matlab for loops on empty row vector
Date: Tue, 30 Jan 2024 03:19:58 -0500 (EST)

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

                 Summary: matlab for loops on empty row vector
                   Group: GNU Octave
               Submitter: arb
               Submitted: Tue 30 Jan 2024 09:19:58 AM CET
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: dev
         Discussion Lock: Any
        Operating System: Any
           Fixed Release: None
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Tue 30 Jan 2024 09:19:58 AM CET By: A.R. Burgers <arb>
matlab will happily loop on empty row vectors.

There are quite a few reports on differences between octave and matlab on
empty array handling, but I didn't find this one yet. With this example


nc = 4;
z = zeros(0, nc)
z_empty = isempty(z)
for i = z
  a = i
end


octave outputs


z = [](0x4)
z_empty = 1


matlab R2019B output this:


z = 0×4 empty double matrix
z_empty = logical 1
a = 0×1 empty double column vector
a = 0×1 empty double column vector
a = 0×1 empty double column vector
a = 0×1 empty double column vector









    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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