%% Specify Table Variables and Row Names Using String Arrays
% Starting in R2017a, you can create strings using double quotes, and add string arrays as table variables.

FlightNum = [1261;547;3489];
Customer = ["Jones";"Brown";"Smith"];
Date = datetime(2016,12,20:22)';
Rating = categorical(["Good";"Poor";"Fair"]);
Comment = ["Flight left on time, not crowded";...
           "Late departure, ran out of dinner options";...
           "Late, but only by half an hour. Otherwise fine."];
T = table(FlightNum,Customer,Date,Rating,Comment)

%
% To use the text in a string array as row names, convert the string array to a cell array of character vectors. Then create a table with row names.

Customer = cellstr(Customer);
T = table(FlightNum,Date,Rating,Comment,'RowNames',Customer)

% Copyright 2012 The MathWorks, Inc.