%% Specify Variable
% Create a table that contains tables, using arrays of data from the patients.mat file. Display the first three rows.

load patients
Personal_Data = table(Gender,Age);
BMI_Data = table(Height,Weight);
BloodPressure = table(Systolic,Diastolic);
T1 = table(LastName,Personal_Data,BMI_Data,BloodPressure);
head(T1,3)

%
% Specify BloodPressure as the variable to split.

T2 = splitvars(T1,'BloodPressure');
head(T2,3)

%
% To specify multiple variables by name, use a cell array of character vectors.

T3 = splitvars(T1,{'BMI_Data','BloodPressure'});
head(T3,3)

%
% To specify variables by position, use a numeric array.

T4 = splitvars(T1,[2 4]);
head(T4,3)

%
% Copyright 2012 The MathWorks, Inc.