# HG changeset patch # User Jaroslav Hajek # Date 1281097368 -7200 # Node ID 5a55773fcaa93f19dfa6f1c53efda3204a840b96 # Parent 337db4e1342d30d028146d699656be7359652ab0 allow structs in cell2mat diff -r 337db4e1342d -r 5a55773fcaa9 scripts/ChangeLog --- a/scripts/ChangeLog Thu Aug 05 20:28:16 2010 -0400 +++ b/scripts/ChangeLog Fri Aug 06 14:22:48 2010 +0200 @@ -1,3 +1,7 @@ +2010-08-06 Jaroslav Hajek + + * general/cell2mat.m: Allow cells of struct arrays. + 2010-08-05 Ben Abbott * /plot/__print_parse_opts__.m, plot/__fltk_print__.m: Don't warn on diff -r 337db4e1342d -r 5a55773fcaa9 scripts/general/cell2mat.m --- a/scripts/general/cell2mat.m Thu Aug 05 20:28:16 2010 -0400 +++ b/scripts/general/cell2mat.m Fri Aug 06 14:22:48 2010 +0200 @@ -43,9 +43,10 @@ valid |= cellfun (@islogical, c); valid |= cellfun (@ischar, c); validc = cellfun (@iscell, c); + valids = cellfun (@isstruct, c); - if (! all (valid(:)) && ! all (validc(:))) - error ("cell2mat: wrong type elements or mixed cells and matrices"); + if (! all (valid(:)) && ! all (validc(:)) && ! all (valids(:))) + error ("cell2mat: wrong type elements or mixed cells, structs and matrices"); endif if (nb == 0)