%% Rename Variables
% Create a table. Add variables and give them new names in the table.
% First, create a table from workspace variables.

load patients
T1 = table(LastName,Age,Gender,Smoker);
head(T1,3)

%
% Combine Diastolic and Systolic into one matrix with two columns. Name the new table variable BloodPressure.

T2 = addvars(T1,[Diastolic Systolic],'NewVariableNames','BloodPressure');
head(T2,3)

%
% Add Height and Weight as new table variables. Rename them Inches and Pounds.

T3 = addvars(T2,Height,Weight,'Before','Smoker','NewVariableNames',{'Inches','Pounds'});
head(T3,3)

% Copyright 2012 The MathWorks, Inc.