Programmer Guide/SPU Reference/LENGTH: Difference between revisions

From STX Wiki
Jump to navigationJump to search
m (1 revision: Initial import)
No edit summary
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
====LENGTH - vector length====
{{SPAtomTemplate}}
 
Number of elements in <var>A</var>
Compute number of elements of input <var>A</var>.
==<code>[SPU LENGTH <var>A</var> OUT <var>Y NROW NCOL N</var>]</code>==
 
If <var>A</var> is a numerical data element (number, vector or matrix), the dimensions of <var>A</var> are stored in the outputs.
{|
{|class="einrahmen"
!Out !!Description
|-
|<var>Y</var> || number of rows; 1 if <var>A</var> is a number and &gt;1 otherwise
|-
|-
|if A is a number:
|<var>NROW</var> || number of rows; 1 if <var>A</var> is a number and &gt;1 otherwise
|Y = 1
|-
|-
|if A is a vector:
|<var>NCOL</var> || number of columns; 1 if <var>A</var> is a number or vector and &gt;1 otherwise
|Y = number of elements of <var>A</var>
|}
 
=====Usage:=====
 
<code>LENGTH <var>A</var></code>
 
=====Inputs:=====
 
{|
|-
|-
|A
|<var>N</var> || number of elements = number of rows * number of columns
|number or vector
|}
|}


=====Outputs:=====
Note: The output values are assigned during the SPU initialization and cannot be changed during execution.
 
;See also:
{|
<[[../#Signal Processing Atoms|SP-atoms]]>
|-
<!-- AN, 2.5.2011 -->
|<var>Y</var>
|number of elements of A (number)
|}

Latest revision as of 08:31, 13 October 2015

Number of elements in A

[SPU LENGTH A OUT Y NROW NCOL N]

If A is a numerical data element (number, vector or matrix), the dimensions of A are stored in the outputs.

Out Description
Y number of rows; 1 if A is a number and >1 otherwise
NROW number of rows; 1 if A is a number and >1 otherwise
NCOL number of columns; 1 if A is a number or vector and >1 otherwise
N number of elements = number of rows * number of columns

Note: The output values are assigned during the SPU initialization and cannot be changed during execution.

See also

<SP-atoms>

Navigation menu

Personal tools