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

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

[Octave-bug-tracker] [bug #65876] error retrieving data from struct valu


From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #65876] error retrieving data from struct values in containers.Maps
Date: Fri, 14 Jun 2024 04:24:25 -0400 (EDT)

Follow-up Comment #9, bug #65876 (group octave):

With this slightly changed version of the classdef:

classdef foocls2
  methods
    function varargout = subsref (obj, idx)
      nout = nargout
      varargout = ...
        num2cell (struct ('x', num2cell (zeros (size (idx(1).subs{1})))));
    end
  end
end


I'm seeing the following results in Matlab R2024a:

>> x(1:3).x
nout =
     3

ans = 
  struct with fields:
    x: 0

ans = 
  struct with fields:
    x: 0

ans = 
  struct with fields:
    x: 0

>> x('ab').x
nout =
     2

ans = 
  struct with fields:
    x: 0

ans = 
  struct with fields:
    x: 0

>> 


The second expression would probably break with the patch from comment #5.
(But I haven't actually tested that.)


    _______________________________________________________

Reply to this item at:

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

{savane: Include the next line when replying by email.}
{savane: user = octave-bug-tracker@gnu.org; tracker = bugs; item = 65876}

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




reply via email to

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