| MATLAB Function Reference | ![]() |
Structure to cell array conversion
Syntax
c = struct2cell(s)
Description
c = struct2cell(s)
converts the m-by-n structure s (with p fields) into a p-by-m-by-n cell array c.
If structure s is multidimensional, cell array c has size [p size(s)].
Examples
clear s, s.category = 'tree'; s.height = 37.4; s.name = 'birch';
s =
category: 'tree'
height: 37.4000
name: 'birch'
Converting the structure to a cell array,
c = struct2cell(s)
c =
'tree'
[37.4000]
'birch'
See Also
| struct | strvcat | ![]() |