Convert structure to cell array
c = struct2cell(s)
c = struct2cell(s) converts
s is multidimensional, cell
c has size
clear s, s.category = 'tree'; s.height = 37.4; s.name = 'birch';
create the structure
s = category: 'tree' height: 37.4000 name: 'birch'
Converting the structure to a cell array,
c = struct2cell(s) c = 'tree' [37.4000] 'birch'
fieldnames to obtain structure
field names in the same order as
Usage notes and limitations:
For a variable-size structure array, the resulting
cell array must be homogeneous. If
s is a variable-size
structure array, the fields must have the same type.
struct2cell cannot convert
a homogeneous cell array, the output cell array is heterogeneous.
A heterogeneous output cell array can have a maximum of 1024 elements.