cell2struct
Convert a cell array to a structure with named fields.
Syntax
Section titled “Syntax”s = cell2struct(C, fields, dim)Description
Section titled “Description”Creates a structure (or struct array) by treating slices of C along dimension dim as field values. fields is a cell array of field-name strings whose length matches size(C, dim).
Examples
Section titled “Examples”cell2struct({1; 'foo'; [3 4]}, {'a', 'b', 'c'}, 1)% struct with fields a=1, b='foo', c=[3 4]See also
Section titled “See also”struct2cell— Convert a structure to a cell array.struct— Create a structure with named fields.cell— Information about formatting, location, or contents of a cell.