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

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

[Octave-bug-tracker] [bug #33218] transpose (') operator not working on


From: Rik
Subject: [Octave-bug-tracker] [bug #33218] transpose (') operator not working on scalar structs
Date: Wed, 04 May 2011 01:35:20 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110422 Ubuntu/10.04 (lucid) Firefox/3.6.17

Update of bug #33218 (project octave):

                  Status:                    None => Confirmed              

    _______________________________________________________

Follow-up Comment #1:

This bug is confirmed on both 3.4.0 and the development branch.  Very simple
test code to reproduce is


s.a = 1;
s'
error: unary operator `'' not implemented for `scalar struct' operands


For the original reporter, there are several workarounds.  One would be to use
a dummy index variable in the loop like so:


for i = 1:numel (STRUCT_LIST)
  ITEM = STRUCT_LIST(i);
  ...
end


A second approach would to use reshape() to get the row vector you are looking
for rather than the combination of (:) to produce a column vector and
transpose ' to change the column vector to a row vector.  For example:


for ITEM = reshape (STRUCT_LIST, 1, numel (STRUCT_LIST))
  ...
end


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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