%!demo
%! ## By default `table2struct` returns a **struct array**, one element per row,
%! ## with one field per variable — handy for row-wise iteration.
%!
%! LastName = {'Sanchez'; 'Johnson'; 'Li'};
%! Age = [38; 43; 38];
%! Height = [71; 69; 64];
%! T = table (LastName, Age, Height)
%! S = table2struct (T);
%! S(2).LastName
%! S(2).Age

%!demo
%! ## Pass `'ToScalar', true` to instead get a **scalar struct** whose fields are
%! ## whole columns — the layout used by `struct2table` with `'AsArray', true`.
%!
%! LastName = {'Sanchez'; 'Johnson'; 'Li'};
%! Age = [38; 43; 38];
%! Height = [71; 69; 64];
%! T = table (LastName, Age, Height)
%! S = table2struct (T, 'ToScalar', true)
%!
%! ## Now each field holds every value of that variable at once.
%! S.Age
