User`s guide
ones
11-207
ones
Array of ones
Syntax
N = ones(sz,arraytype)
N = ones(sz,datatype,arraytype)
N = ones(sz,'like',P)
N = ones(sz,datatype,'like',P)
C = ones(sz,codist)
C = ones(sz,datatype,codist)
C = ones(sz, ___ ,codist,'noCommunication')
C = ones(sz, ___ ,codist,'like',P)
Description
N = ones(sz,arraytype) creates a matrix with underlying class of double, with ones
in all elements.
N = ones(sz,datatype,arraytype) creates a matrix with underlying class of
datatype, with ones in all elements.
The size and type of array are specified by the argument options according to the
following table.
Argument Values Descriptions
n Specifies size as an n-by-n matrix.
m,n or [m n] Specifies size as an m-by-n matrix.
sz
m,n,...,k or [m
n ... k]
Specifies size as an m-by-n-by-...-by-k array.
'distributed'
Specifies distributed array.
arraytype
'codistributed'
Specifies codistributed array, using the default
distribution scheme.