bugGNU Octave - Bugs: bug #30665, cell2mat no longer works for...

 
 

bug #30665: cell2mat no longer works for structures

Submitter:  Muhali <muhali>
Submitted:  Thu 05 Aug 2010 09:06:15 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Assigned to:  highegg
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 06 Aug 2010 12:33:35 PM UTC, comment #2: 
Jaroslav Hajek <highegg>
Fri 06 Aug 2010 02:57:24 AM UTC, comment #1: 

The sample code works in version 3.2.4 and produces the following result,

ans =
{
  1x2 struct array containing the fields:

    x
}

which matches the Matlab behavior.

The incorrect behavior has been confirmed on a recent tip (8/5/10).

Rik <rik5>
Group administrator
Thu 05 Aug 2010 09:06:15 PM UTC, original submission:  

Unlike matlab, octave does not allow for structure elements in cell2mat:

matlab> a{1}.x = 1 ;
matlab> a{2}.x = pi ;
matlab> b=cell2mat(a)

b =

1x2 struct array with fields:
    x

octave> a{1}.x = 1 ;
octave> a{2}.x = pi ;
octave> b=cell2mat(a)
error: cell2mat: wrong type elements or mixed cells and matrices
error: called from:
error:   /home/gbuerger/loc/octave/share/octave/3.3.52+/m/general/cell2mat.m at line 48, column 5

Muhali <muhali>

 

(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 highegg (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by muhali (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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-08-06 highegg Open/ClosedOpen Closed
    2010-08-06 highegg StatusConfirmed Fixed
        Assigned toNone highegg
    2010-08-06 rik5 StatusNone Confirmed
        Summarycell2mat not for structures cell2mat no longer works for structures

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code