%% Select Variables in Timetable
% Create a timetable that contains numeric, string, and categorical variables. Then subscript into the table to get only its numeric variables.

Date = datetime({'12/18/2015';'12/19/2015';'12/20/2015'});
Temp = [45;33;36];
Pressure = [30.1;29.3;29.7];
Location = string({'Boston';'Boston';'Worcester'});
SensorType = categorical({'S1';'X7';'S1'});
TT = timetable(Date,Temp,Pressure,Location,SensorType)

%
% Create a subscript with the vartype function. Subscript into the second dimension of TT to return a timetable that contains only the numeric variables. TT2 also has the row times from TT because the times identify the rows. The vector of row times is a property of the timetable, and not one of its variables.

S = vartype('numeric');
TT2 = TT(:,S)

% Copyright 2012 The MathWorks, Inc.