Mercurial > hg > octave-nkf
diff src/ov-cell.cc @ 9109:978c863bc8e5
Treat possible trailing singleton for creation of cell array from column structure vector
author | David Bateman <dbateman@free.fr> |
---|---|
date | Sat, 11 Apr 2009 16:05:16 +0200 |
parents | 1eb5b24186b6 |
children | c2248cc4821a |
line wrap: on
line diff
--- a/src/ov-cell.cc +++ b/src/ov-cell.cc @@ -1358,9 +1358,13 @@ // The resulting dim_vector should have dimensions: // [numel(fields) size(struct)] + // except if the struct is a column vector. dim_vector result_dv; - result_dv.resize (m_dv.length () + 1); // Add 1 for the fields. + if (m_dv (m_dv.length () - 1) == 1) + result_dv.resize (m_dv.length ()); + else + result_dv.resize (m_dv.length () + 1); // Add 1 for the fields. result_dv(0) = num_fields;