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}}}}
Create a vector with equally spaced elements.
Create a vector with equally spaced elements.
 
;Usage: <code>fill(<var>n</var> {, <var>x0</var> {, <var>dx</var>}})</code>
;Usage: '''<code>fill(<var>n</var> {, <var>x0</var> {, <var>dx</var>}})</code>'''
:;<var>n</var>: vector length, a scalar (>0)
:;<var>n</var>: vector length, a scalar (>0)
::note: if ''n'' is a vector, ncol(''n'') is used as number of elements
::note: if ''n'' is a vector, ncol(''n'') is used as number of elements
Line 8: Line 7:
:;<var>dx</var>: increment, must be a scalar (default='''0''')
:;<var>dx</var>: increment, must be a scalar (default='''0''')
;Result: The result is a vector r with ''n'' elements. The elements are initialized with: <code>''r''<sub>i</sub> = ''x0'' + i*''dx''; i=0..''n''-1''</code>
;Result: The result is a vector r with ''n'' elements. The elements are initialized with: <code>''r''<sub>i</sub> = ''x0'' + i*''dx''; i=0..''n''-1''</code>
;See also: [[Programmer_Guide/Command_Reference/EVAL/init|init]], [[Programmer_Guide/Command_Reference/EVAL/rand|rand]]
;See also: [[../init|init]], [[../rand|rand], [[../vv|vv]]


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

Revision as of 10:42, 21 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
x0
start value, must be a scalar (default=0)
dx
increment, 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, [[Programmer Guide/Command Reference/EVAL/rand|rand], vv

<function list>

Navigation menu

Personal tools