Create a table, T
, with five rows and three variables.
T =
Gender Age BloodPressure
______ ___ _____________
M 38 124 93
M 43 109 77
F 38 125 83
F 40 117 75
F 49 122 80
Convert T
to a structure array.
S =
5×1 struct array with fields:
Gender
Age
BloodPressure
The structure is 5-by-1, corresponding to the five rows of the table, T
. The three fields of S
correspond to the three variables from T
.
Display the field data for the first element of S
.
ans =
struct with fields:
Gender: M
Age: 38
BloodPressure: [124 93]
The information corresponds to the first row of the table.