The ROWNAME= and COLNAME= Options in the PRINT Statement

You can specify your own row and column headings. The easiest way is to create vectors that contain the headings and then display the matrix by using the ROWNAME= and COLNAME= options in the PRINT statement. For example, the following statements display row names and column names for a matrix:

names={Jenny, Linda, Jim, Samuel};
days={Mon Tue Wed Thu Fri};
mattrib coffee rowname=names colname=days;
print coffee;

Figure 5.32: Result of the ROWNAME= and COLNAME= Options

coffee
  MON TUE WED THU FRI
JENNY 4 2 2 3 2
LINDA 3 3 1 2 1
JIM 2 1 0 2 1
SAMUEL 5 4 4 3 4