Language Reference

NCOL Function

NCOL (matrix) ;

This function is supported by the IML procedure and the iml action.

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

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

m = {1 2 3, 4 5 6, 3 2 1, 4 3 2, 5 4 3};
p = ncol(m);
print p;

Figure 266: Number of Columns in a Matrix

p
3


Last updated: May 07, 2026