ncol (alias: cols)

From STX Wiki
< Programmer Guide‎ | Command Reference‎ | EVAL
Revision as of 11:25, 21 April 2011 by 193.171.195.48 (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Returns the number of columns of the argument x.

Usage
ncol(x)
Result
The result of this function is the number of columns of x. If x is a scalar or a vector, the result is 1.
See also
nrow

<function list>


Example:

#matrix := eval init(100,10,0)
conlog 'number of columns of $#matrix: $(eval ncol($#matrix))'
// the attribute !ncol returns the same value:
conlog 'number of columns of $#matrix: $#matrix[!ncol]'

Navigation menu

Personal tools