%% Write Table to Space-Delimited Text File
% Create a table.

T = table(['M';'F';'M'],[45 45;41 32;40 34],...
    {'NY';'CA';'MA'},[true;false;false])

%
% Write the table to a space-delimited text file named myData.txt and display the file contents.

writetable(T,'myData.txt','Delimiter',' ')  
type 'myData.txt'

% writetable appends a unique suffix to the variable name, Var2, above the two columns of corresponding data.
% Copyright 2015 The MathWorks, Inc.