bugGNU Octave - Bugs: bug #33218, transpose (') operator not working...

 
 

bug #33218: transpose (') operator not working on scalar structs

Submitted by:  None
Submitted on:  Tue 03 May 2011 02:07:47 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Jochen WeberOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.4.0
Operating System: Mac OS

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 05 May 2011 01:53:30 AM UTC, comment #2:

I checked in the following change to the stable branch:

http://hg.savannah.gnu.org/hgweb/octave/rev/eaba9d671fb7

John W. Eaton <jwe>
Project Administrator
Wed 04 May 2011 01:35:19 AM UTC, comment #1:

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

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

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:

Rik <rik5>
Project Administrator
Tue 03 May 2011 02:07:47 PM UTC, original submission:

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

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

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

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 05 May 2011 01:53:30 AM UTCjweStatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Wed 04 May 2011 01:35:19 AM UTCrik5StatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup1