ones {matlab}R Documentation

MATLAB ones/zeros functions

Description

Create a matrix consisting of all ones or zeros.

Usage

ones(n, m = n)
zeros(n, m = n)

Arguments

n, m numeric scalars specifying dimensions for the result

Value

Returns matrix consisting only of ones (or zeros). Defaults to square if second dimension argument m not provided.

Author(s)

P. Roebuck, roebuck@mdanderson.org

See Also

eye

Examples

ones(3)
zeros(3)

[Package matlab version 0.7-8 Index]