zeros & ones {optimbase} | R Documentation |
Matrix of zeros or ones.
Description
Creates a matrix of zeros or ones.
Usage
zeros(nx = 1, ny = nx)
ones(nx = 1, ny = nx)
Arguments
nx |
The number of rows. Default is 1. |
ny |
The number of columns. Default is |
Details
zeros
and ones
create full matrices of zeros and ones. If the
user only provides an input for nx
, the produced matrices are nx x nx
square matrices.
Value
Return of nx x ny matrix of zeros of ones.
Author(s)
Sebastien Bihorel (sb.pmlab@gmail.com)
Examples
zeros()
zeros(3)
ones(4,5)
# Will fail
try(ones('3','3'))
[Package optimbase version 1.0-10 Index]