%% Treat Scalar Structure As Array
% Use 'AsArray',true to create a table from a scalar structure whose fields have different numbers of rows.
% Create a scalar structure, S, with fields name, billing, and test.

S.name = 'John Doe';
S.billing = 127.00;
S.test = [79, 75, 73; 180, 178, 177.5; 220, 210, 205];
S

% The fields have different numbers of rows. Therefore, you cannot use struct2table(S), which uses 'AsArray',false by default.
%
% Treat the scalar structure as an array and convert it to a table.

T = struct2table(S,'AsArray',true)

% T contains one row.
% Copyright 2012 The MathWorks, Inc.