Creates an array of all ones.
ONES(numrows, numcols, dx, dy)
numrows |
- |
An integer. The number of output rows. |
numcols |
- |
Optional. An integer, the number of output columns. Defaults to numrows. |
dx |
- |
Optional. A real, the increment between X values. Defaults to 1.0. |
dy |
- |
Optional. A real, the increment between Y values. Defaults to 1.0. |
A series or array.
ones(3, 1)
returns the series {1, 1, 1}
ones(3, 1, 0.1)
Same as the previous example except the DELTAX is set to 0.1.
ones(3)
returns the 3x3 array:
{{1, 1, 1},
{1, 1, 1},
{1, 1, 1}}
ones(size(A)) returns a array of all ones with same dimension as A.