%% New Names for Split Variables
% Create a table that contains multi-column variables, using data from the patients.mat file. Display the first three rows.

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

%
% Split BloodPressure and specify new names for the new variables in the output table.

T2 = splitvars(T1,'BloodPressure','NewVariableNames',{'Systolic','Diastolic'});
head(T2,3)

%
% Split both BMI_Data and BloodPressure. For each variable being split, you must provide a cell array with the correct number of new names.

T3 = splitvars(T1,{'Personal_Data','BloodPressure'},...
     'NewVariableNames',{{'Age','Height','Weight'},{'Systolic','Diastolic'}});
head(T3,3)

% Copyright 2012 The MathWorks, Inc.