bugGNU Octave - Bugs: bug #36817, Concatenation of null array and...

 
 

bug #36817: Concatenation of null array and struct fails

Submitter:  None
Submitted:  Mon 09 Jul 2012 01:18:02 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Andrew M. Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.4.0
Operating System:  * Mac OS Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 09 Jul 2012 03:13:39 PM UTC, comment #1: 

This problem appears to be fixed in the current release, 3.6.2, where I see the following behavior:


octave:1> s=struct('name', 'jim')
s =

  scalar structure containing the fields:

    name = jim

octave:2> y=[[], s] %This fails
y =

  scalar structure containing the fields:

    name = jim


John W. Eaton <jwe>
Group administrator
Mon 09 Jul 2012 01:18:02 PM UTC, original submission:  

In Matlab I often create an empty array and then use a loop to conditionally add elements to the array concatenation. In Octave this works fine for integer data types, but fails for structs. For example:


a=5
x=[[], a] %This works

s=struct('name', 'jim')
y=[[], s] %This fails


The error message is:

concatenation operator not implemented for `scalar struct' by `scalar struct' operations


My feeling is that the second concatenation should work the same as the first one, and the same as it does in Matlab. If there is a workaround for this please let me know.

Thanks.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-07-09 jwe StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code