init
From STX Wiki
< Programmer Guide | Command Reference | EVAL
Jump to navigationJump to search
Create a vector or a matrix and initialize it with a particular value.
- Usage
init(rows {, cols {, value}})
- 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, rand
Parameters:
- rows
- The number of rows. There is no default.
- cols
- The number of columns. The default is
1
.
- value
- The value to initialize with. The default is
0
.
Return Type:
vector or matrix