Programmer Guide/Command Reference/EVAL/ncol: Difference between revisions

From STX Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 5: Line 5:
;Usage: '''<code>ncol(<var>x</var>)</code>'''
;Usage: '''<code>ncol(<var>x</var>)</code>'''


;Result: The result of this function is the number of columns of <var>x</var>. If <var>x</var> is a scalar or a vector, the result is '''1'''. The function '''cols(''x'')''' and the special ''bracket'' form '''|''x''|''' can be used as alias for '''ncol'''.
;Result: The result of this function is the number of columns of <var>x</var>. If <var>x</var> is a scalar or a vector, the result is '''1'''. The function '''cols(''x'')''' can be used as alias for '''ncol'''.
 
;Example:<pre>
#matrix := eval init(100,10,0)
conlog 'number of columns of $#matrix: $(eval ncol($#matrix)'
</pre>


;See also: [[Programmer_Guide/Command_Reference/EVAL/nrow|nrow]]
;See also: [[Programmer_Guide/Command_Reference/EVAL/nrow|nrow]]


[[Programmer_Guide/Command_Reference/EVAL#Functions|<function list>]]
[[Programmer_Guide/Command_Reference/EVAL#Functions|<function list>]]

Revision as of 11:06, 4 April 2011


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. The function cols(x) can be used as alias for ncol.
Example
  1. matrix := eval init(100,10,0)

conlog 'number of columns of $#matrix: $(eval ncol($#matrix)'

See also
nrow

<function list>

Navigation menu

Personal tools