%!demo
%! ## Store patient data in a table
%!
%! LastName = {'Sanchez'; 'Johnson'; 'Li'; 'Diaz'; 'Brown'};
%! Age = [38;43;38;40;49];
%! Smoker = logical ([1; 0; 1; 0; 1]);
%! Height = [71; 69; 64; 67; 64];
%! Weight = [176; 163; 131; 133; 119];
%! BloodPressure = [124, 93; 109, 77; 125, 83; 117, 75; 122, 80];
%! T = table (LastName, Age, Smoker, Height, Weight, BloodPressure)
%!
%! ## Use indexing to access variables
%! meanHeight = mean (T.Height)
%!
%! ## Calculate body mass index (BMI), and add it as a new table variable.
%! pounds2kg = 0.4535924;
%! inch2meter = 0.0254;
%! T.BMI = (T.Weight * pounds2kg) ./ (T.Height * inch2meter) .^ 2
