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: anonymous
Subject: [Octave-bug-tracker] [bug #33218] transpose (') operator not working on scalar structs
Date: Tue, 03 May 2011 14:07:48 +0000
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0.1) Gecko/20100101 Firefox/4.0.1

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

                 Summary: transpose (') operator not working on scalar structs
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Tue 03 May 2011 02:07:47 PM UTC
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Jochen Weber
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.4.0
        Operating System: Mac OS

    _______________________________________________________

Details:

Again, I'm using a construction which I think should be permissible frequently
in my Matlab code:


for ITEM = LIST(:)',
    CODEBLOCK;
end


The colon operator followed by the transpose operation makes sure that the
for-loop indeed selects individual items from LIST. Now, if LIST is of type
struct, this works for any size combination (with 2 dims, obviously), 0x0,
0xN, Nx0, 1xN, Nx1, MxN, except 1x1 (scalar struct), which IMO should just
return the same object. While there is a workaround possible by adding a
construction like


if numel(LIST) ~= 1,
    % FORLOOP;
else,
    % SINGLEBLOCK;
end


around the code, this is really cumbersome and should not be necessary, should
it?




    _______________________________________________________

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]