<< moc_postpad Matlab/Octave Compatibility toolbox moc_randi >>

Matlab/Octave Compatibility toolbox >> Matlab/Octave Compatibility toolbox > moc_prepad

moc_prepad

prepend the scalar

Calling Sequence

y = moc_prepad (x, l,c)
y = moc_prepad (x, l,c,dim)

Description

Prepend the scalar value c to the vector x until it is of length l. If the third argument is not supplied, a value of 0 is used.

If length (x > l}, elements from the beginning of x are removed until a vector of length l is obtained.

If x is a matrix, elements are prepended or removed from each row.

If the optional dim argument is given, then operate along this dimension.

See also

Authors


Report an issue
<< moc_postpad Matlab/Octave Compatibility toolbox moc_randi >>