Description Usage Arguments See Also Examples
ones
produces either a vector or a matrix of ones
ones_vector
produces a vector of ones of a
given length
ones_matrix
produces a matrix of
ones of a given dimension
1 |
n |
indicates either the length (for vector) or the number of rows (for matrix) |
p |
indicates the number of columns (for matrix) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # vector of ones with 5 elements
ones(5)
# equivalently
ones_vector(5)
# 3x3 matrix of ones
ones(3, 3)
# equivalently
ones_matrix(3, 3)
# 1x3 matrix of ones
ones(1, 3)
# 3x1 matrix of ones
ones(3, 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.