ones: MATLAB ones/zeros functions

Description Usage Arguments Value Author(s) See Also Examples

Description

Create a matrix consisting of all ones or zeros.

Usage

1
2

Arguments

...

numeric dimensions for the result

Value

Returns matrix consisting only of ones (or zeros). Defaults to square if dimension argument resolves to a single value.

Author(s)

P. Roebuck proebuck@mdanderson.org

See Also

eye

Examples

1
2
3
4
5
ones(3)
ones(c(3, 3))                   # same thing 
ones(3, 3)                      # same thing
ones(size(matrix(NA, 3, 3)))    # same thing
zeros(3)


Search within the matlab package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.