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

From STX Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
=====fill=====
Create a vector with a linear function.
=====Usage:=====
<code>fill(<var>n</var>, <var>d</var>, <var>k</var>)</code>
=====Parameters:=====
;<var>n</var>
:The number of elements. There is no default.
;<var>d</var>
:The start value. The default is <code>0</code>.
;<var>k</var>
:The increment step value. The default is <code>0</code>.
=====Result:=====
The result is: x[i = 0..<var>n</var>-1] = <var>d</var> + i*<var>k</var>
=====Notes:=====
If <var>n</var> is a vector, the length of the vector is used.
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
Create a vector with equally spaced elements.
Create a vector with equally spaced elements.



Revision as of 13:07, 4 April 2011

Create a vector with equally spaced elements.

Usage
fill(n{, x0{, dx}})
n
vector length, a scalar (>0)
note: if n is a vector, ncol(n) is used as number of elements
x0start value, must be a scalar (default=0)
dxincrement, must be a scalar (default=0)
Result
The result is a vector r with n elements. The elements are initialized with: ri = x0 + i * dx; i=0..n-1
See also
init, rand

<function list>

Navigation menu

Personal tools