bugGNU Octave - Bugs: bug #51081, [] Square bracket concatenation of...

 
 

bug #51081: [] Square bracket concatenation of empty cell and struct gives error

Submitter:  -X- <jsh>
Submitted:  Sun 21 May 2017 11:52:07 AM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  3 - Low Item Group:  Matlab Compatibility
Status:  Duplicate Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 22 May 2017 03:37:51 PM UTC, comment #2: 

This was reported long ago, still open, see bug #39041.

Mike Miller <mtmiller>
Group Member
Mon 22 May 2017 12:40:11 AM UTC, comment #1: 

Confirmed.  This is also present on the development branch so I have changed the Relase to "dev" for the report.

For clarity, this works:


vertcat ({}, struct('f',1))
horzcat ({}, struct('f',1))


However, at the interpreter level only vertical concatenation works.


[ {} ; struct('f',1) ]          % works
[ {} , struct('f',1) ]          % fails
error: octave_base_value::cell_value(): wrong type argument 'scalar struct'


Note that it is a problem for cell concatenation.  With an emptry matrix it works.


[ [] , struct('f',1) ]          % works



Rik <rik5>
Group administrator
Sun 21 May 2017 11:52:07 AM UTC, original submission:  

[] Square bracket concatenation of empty cell and struct gives error, while horzcat returns the correct struct in cell array (Matlab works for both)


horzcat({},struct('f',1)), [{} struct('f',1)]


-X- <jsh>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by jsh (Submitted the item)
  •  

    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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-05-22 mtmiller StatusConfirmed Duplicate
        Open/ClosedOpen Closed
        Dependencies- Depends on bugs #39041
    2017-05-22 rik5 Priority5 - Normal 3 - Low
        StatusNone Confirmed
        Release4.2.1 dev

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code