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

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

[Octave-bug-tracker] [bug #51633] Empty indexing of struct returns empty


From: Dan Sebald
Subject: [Octave-bug-tracker] [bug #51633] Empty indexing of struct returns empty struct array
Date: Tue, 1 Aug 2017 15:09:59 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

Follow-up Comment #6, bug #51633 (project octave):

It sounds to me like x() should always be the same as plain x.  In Octave,


octave:13> a = 1:10;
octave:14> a()
ans =

    1    2    3    4    5    6    7    8    9   10




octave:18> b(1) = struct('x',1:10);
octave:19> b(2) = struct('x',1:10);
octave:20> b
b =

  1x2 struct array containing the fields:

    x

octave:21> b() % not the same as b
ans =

  0x0 struct array containing the fields:

    x

octave:22> b(1)
ans =

  scalar structure containing the fields:

    x =

        1    2    3    4    5    6    7    8    9   10



In the vector case, 'a()' is the same as 'a'... not 'a(1)'.  So for
consistency, I would think that 'b()' should print out whatever 'b' prints
out--which isn't necessarily the same as what 'b(1)' prints out.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?51633>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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