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

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

[Octave-bug-tracker] [bug #61843] Regression with subscripted assignment


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #61843] Regression with subscripted assignments with arrays of objects
Date: Tue, 25 Jan 2022 14:42:40 -0500 (EST)

Follow-up Comment #3, bug #61843 (project octave):

just playing with structs and not classes, the following works in both matlab
and octave, so it seems to be class specific?


>> a = struct('b',1)
a =
  scalar structure containing the fields:
    b = 1

>> c = struct('d',a)
c =
  scalar structure containing the fields:
    d =
      scalar structure containing the fields:
        b = 1

>> c.d
ans =
  scalar structure containing the fields:
    b = 1

>> c.d.b
ans = 1

>> c.d.b = 3
c =
  scalar structure containing the fields:
    d =
      scalar structure containing the fields:
        b = 3

>> clear c

>> c(1) = struct('d',a)
c =
  scalar structure containing the fields:
    d =
      scalar structure containing the fields:
        b = 1

>> c(2) = struct('d',a)
c =
  1x2 struct array containing the fields:
    d

>> c.d
ans =
  scalar structure containing the fields:
    b = 1

ans =
  scalar structure containing the fields:
    b = 1

>> c.d.b
error: a cs-list cannot be further indexed

>> c(1).d.b
ans = 1

>> c(2).d.b
ans = 1

>> c(2).d.b = 3
c =
  1x2 struct array containing the fields:
    d

>> c(2).d.b
ans = 3



    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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