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

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

[Octave-bug-tracker] [bug #60726] nargout for {} in subsref() method doe


From: Ray Zimmerman
Subject: [Octave-bug-tracker] [bug #60726] nargout for {} in subsref() method does not match MATLAB
Date: Thu, 3 Jun 2021 14:55:49 -0400 (EDT)
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15

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

                 Summary: nargout for {} in subsref() method does not match
MATLAB
                 Project: GNU Octave
            Submitted by: rdzman
            Submitted on: Thu 03 Jun 2021 06:55:47 PM UTC
                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: 6.2.0
         Discussion Lock: Any
        Operating System: Any

    _______________________________________________________

Details:

With the following simple classdef ...


classdef nargout_in_subsref_bug < handle
    properties
        c = num2cell(1:5);
    end
    methods
        function varargout = subsref(obj, s)
            disp(nargout)
            [varargout{1:nargout}] = obj.c{s(1).subs{:}};
        end
    end
end


... the following example produces different output on Octave vs. MATLAB.


x = nargout_in_subsref_bug();
x{1};
{x{1}};
x{[2 3]};
{x{[2 3]}};


Octave output:

0
1
0
1


MATLAB output:

     1

     1

     2

     2


In the examples I tried, nargout does seem to match for () and . indexing.




    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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