Language Reference


NROW Function

NROW (matrix);

The NROW function returns the number of rows in its matrix argument. If the matrix has not been given a value, the NROW function returns a value of 0.

For example, following statements display the number of rows of the matrix m:

m = {1 2 3, 4 5 6, 3 2 1, 4 3 2, 5 4 3};
n = nrow(m);
print n;

Figure 24.246: Number of Rows in a Matrix

n
5