Generalized padding for arrays of arbitrary dimension
Array to be padded
Amount of padding to add. If a vector of length greater than
one, it is interpreted as
the extra extent of
String specifying the values of the padded elements. See details section.
Boolean, with default
method specifies the values of the padded elements.
It can be either “
mirror”, or “
ext (the default) uses a padding value given by
the “nearest” element of
a, as measured by the
mirror fills the array with alternate mirror
rep fills it with unreflected copies
apad() does not work with arrays with dimensions of
zero extent: what to pad it with? To pad with a particular value, use
The function works as expected with vectors, which are treated as one-dimensional arrays. See examples section.
apad() is distinct from
adiag(), which takes
two arrays and binds them together. Both functions create an array of
the same dimensionality as their array arguments but with possibly
larger extents. However, the functions differ in the values of the
new array elements. Function
adiag() uses a second array;
apad() takes the values from its primary array argument.
Robin K. S. Hankin
1 2 3 4 5 6 7 8 9 10 11 12
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.