%% Convert Table to Cell Array
% Create a table, T, with five rows and three variables.

T = table(categorical({'M';'M';'F';'F';'F'}),[38;43;38;40;49],...
    [124 93;109 77; 125 83; 117 75; 122 80],...
    'VariableNames',{'Gender' 'Age' 'BloodPressure'},...
    'RowNames',{'Smith' 'Johnson' 'Williams' 'Jones' 'Brown'})

%
% Convert T to a cell array.

C = table2cell(T)

% C is a 5-by-3 cell array.
%
% Vertically concatenate the table property, T.Properties.VariableNames, with C to include column headings for the cell array.

[T.Properties.VariableNames;C]

% T.Properties.VariableNames is a cell array of character vectors.
% Copyright 2012 The MathWorks, Inc.