Function Index
ConstantPad
ConstantPad[
img
,
{
b
1
,
e
1
},
v
]
pads
img
by repeating the constant
v
b
1
times at the beginning and e
1
times at end of
img
.
ConstantPad[
img
,
{
b
1
,
e
1
},
{
b
2
,
e
2
},
...
,
v
]
pads
img
by replicating the constant
v
b
i
and e
i
times, respectively, at level
i
of
img
.
ConstantPad
returns an array of dimensions given by
N
i
+ b
i
+ e
i
, for i=1,2,...,
TensorRank
[
img
]
where N
i
is the
i
th dimension of
img
.
TensorRank
of
img
must match the number of {b
i
, e
i
} arguments.
The argument
img
may be any array or
ImageData
expression.
See also User's Guide
4.4
.
{New in Version 2.}
Examples
This loads the package.
In[1]:=
Here a list is padded on the tail end only.
In[2]:=
Out[2]=
This pads the list on both ends by repeating the constant value 1.
In[3]:=
Out[3]=
This pads the rows and columns on one side only.
In[4]:=
Out[4]//MatrixForm=
© 2008 Wolfram Research, Inc.
•
Terms of Use
•
Privacy Policy
Sign up for our newsletter: