Programmer Guide/Command Reference/EVAL/nrow: Difference between revisions
From STX Wiki
< Programmer Guide | Command Reference | EVAL
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{DISPLAYTITLE: | {{DISPLAYTITLE:nrow (alias: rows}} | ||
Returns the number of rows of the argument <var>x</var>. | Returns the number of rows of the argument <var>x</var>. | ||
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 rows of <var>x</var>. If <var>x</var> is a scalar, the result is '''1 | ;Result: The result of this function is the number of rows of <var>x</var>. If <var>x</var> is a scalar, the result is '''1'''. | ||
;Example: | ;Example: |
Revision as of 11:16, 4 April 2011
Returns the number of rows of the argument x.
- Usage
ncol(x)
- Result
- The result of this function is the number of rows of x. If x is a scalar, the result is 1.
- Example
#vector := eval init(100,1,0) conlog 'number of rows of $#vector: $(eval ncol($#vector))' // the attribute !nrow returns the same value: conlog 'number of rows of $#vector: $#vector[!nrow]'
- See also
- ncol