Language Reference
NROW Function
NROW (matrix) ;
This function is supported by the IML procedure and the iml action.
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 283: Number of Rows in a Matrix
| n |
|---|
| 5 |
Last updated: May 07, 2026