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

From STX Wiki
Jump to navigationJump to search
m (1 revision: Initial import)
No edit summary
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
=====nrow=====


The number of rows in <var>x</var>.
Returns the number of rows of the argument <var>x</var>.


{|
;Usage: '''<code>ncol(<var>x</var>)</code>'''
|-
 
|Usage:
;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'''. The function '''rows(''x'')''' can be used as alias for '''nrow'''.
|nrow(x)
 
|-
;Example:
|
<pre>
|rows(x)
#vector := eval init(100,1,0)
|-
conlog 'number of rows of $#vector: $(eval ncol($#vector))'
|Result:
// the attribute !nrow returns the same value:
|The number of rows in x (1 for scalars).
conlog 'number of rows of $#vector: $#vector[!nrow]'
|-
</pre>
|Return Type:
 
|scalar
;See also: [[Programmer_Guide/Command_Reference/EVAL/ncol|ncol]]
|}
 
[[Programmer_Guide/Command_Reference/EVAL#Functions|<function list>]]

Revision as of 10:10, 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. The function rows(x) can be used as alias for nrow.
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

<function list>

Navigation menu

Personal tools