Create a table.

Add descriptions and units to table `T`

.

Print a summary of table `T`

.

Description: Simulated patient data
Variables:
Gender: 100x1 cell string
Age: 100x1 double
Units: Yrs
Values:
min 25
median 39
max 50
Smoker: 100x1 logical
Values:
true 34
false 66
BloodPressure: 100x2 double
Units: mm Hg
Description: Systolic/Diastolic
Values:
BloodPressure_1 BloodPressure_2
_______________ _______________
min 109 68
median 122 81.5
max 138 99

`summary`

displays the minimum, median, and
maximum values for each column of the variable `BloodPressure`

.

Create a 1-by-5 categorical vector.

A =
plane car train car plane

`A`

has three categories, `car`

, `plane`

,
and `train`

.

Print a summary of `A`

.

`car`

appears in two elements of `A`

, `plane`

appears
in two elements, and `train`

appears in one element.

Since `A`

is a row vector, `summary`

lists
the occurrences of each category horizontally.

Create a 3-by-2 categorical array, `A`

,
from a numeric array.

A =
red blue
green red
blue red
<undefined> green

`A`

has three categories, `red`

, `green`

,
and `blue`

. The value, `4`

, was
not included in the `valueset`

input to the `categorical`

function.
Therefore, the corresponding element, `A(4,1)`

, does
not have a corresponding category and is undefined.

Print a summary of `A`

.

red 1 2
green 1 1
blue 1 1
<undefined> 1 0

`red`

appears in one element in the first column
of `A`

and two in the second column.

`green`

appears in one element in the first
column of `A`

and none in the second column.

`blue`

appears in one element in the first
column of `A`

and one in the second column.

`A`

contains only one undefined element. It
occurs in the first column.

Create a 3-by-2 categorical array, `A`

,
from a numeric array.

A =
red blue
green red
blue red

`A`

has three categories, `red`

, `green`

,
and `blue`

.

Print a summary of `A`

along the second
dimension.

red green blue
1 0 1
1 1 0
1 0 1

`red`

appears in one element in the first row
of `A`

, one in the second row, and one in the third
row.

`green`

appears in only one element. It occurs
in the second row of `A`

.

`blue`

appears in one element in the first
row of `A`

and one in the third column.