Learn R Programming

PopED (version 0.7.0)

ones: Create a matrix of ones

Description

Create a matrix of ones of size (dim1 x dim2).

Usage

ones(dim1, dim2 = NULL)

Value

A matrix of ones

Arguments

dim1

The dimension of the matrix (if square) or the number of rows.

dim2

The number of columns

See Also

Other MATLAB: cell(), diag_matlab(), feval(), fileparts(), isempty(), rand(), randn(), size(), tic(), toc(), zeros()

Examples

Run this code

ones(4)
ones(3,4)

Run the code above in your browser using DataLab