Convert cell to a structure. The number of fields in fields must match the number of elements in cell along dimension dim, that is
numel (
fields) == size (
cell,
dim)
.A = cell2struct ({'Peter', 'Hannah', 'Robert'; 185, 170, 168}, {'Name','Height'}, 1); A(1) ans = { Height = 185 Name = Peter }