Tnew=5×4 table
Smoker Height Weight ID
______ ______ ______ ____
true 71 176 8148
false 69 163 9058
false 64 131 1270
false 67 133 9134
false 64 119 6324
Access Data by Row and Variable Names
Add row names to T and index into the table using row and variable names instead of
numeric indices. Add row names by assigning the LastName workspace variable to the
RowNames property of T.
T.Properties.RowNames = LastName;
Display the first five rows of T with row names.
T(1:5,:)
ans=5×5 table
Gender Smoker Height Weight ID
________ ______ ______ ______ ____
Smith 'Male' true 71 176 8148
Johnson 'Male' false 69 163 9058
Williams 'Female' false 64 131 1270
Jones 'Female' false 67 133 9134
Brown 'Female' false 64 119 6324
Return the size of T. The size does not change because row and variable names are not
included when calculating the size of a table.
size(T)
ans = 1×2
100 5
9 Tables