Skip to content

struct2cell

Convert a structure to a cell array.

c = struct2cell(s)

Returns a cell array containing the values of s’s fields, in the order they appear. The result has one cell per field per struct-array element.

s.a = 1; s.b = 'foo'; s.c = [3 4];
struct2cell(s) % {1; 'foo'; [3 4]}
  • cell2struct — Convert a cell array to a structure with named fields.
  • fieldnames — List of field names in a structure.