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

 
 

bug #30665: cell2mat no longer works for structures

Submitted by:  Muhali <muhali>
Submitted on:  Thu 05 Aug 2010 09:06:15 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: FixedAssigned to: Jaroslav Hajek <highegg>
Originator Name: Open/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Fri 06 Aug 2010 12:33:35 PM UTC, comment #2:

Fixed by
http://hg.savannah.gnu.org/hgweb/octave/rev/5a55773fcaa9

thx for report.

Jaroslav Hajek <highegg>In charge of this item.
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>
Project 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 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 highegg (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by muhali (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 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 06 Aug 2010 12:33:44 PM UTChigheggOpen/ClosedOpen=>Closed
    Fri 06 Aug 2010 12:33:35 PM UTChigheggStatusConfirmed=>Fixed
      Assigned toNone=>highegg
    Fri 06 Aug 2010 02:57:24 AM UTCrik5StatusNone=>Confirmed
      Summarycell2mat not for structures=>cell2mat no longer works for structures

    Back to the top


    Powered by Savane 3.1-cleanup1