% -*- texinfo -*- % @deftypefn {Function File} {@var{B} = } padarray (@var{A},@var{padsize}) % @deftypefnx {Function File} {@var{B} = } padarray (@var{A},@var{padsize},@var{padval}) % @deftypefnx {Function File} {@var{B} = } padarray (@var{A},@var{padsize},@var{padval},@var{direction}) % Pads an array in a configurable way. % % B = padarray(A,padsize) pads an array @var{A} with zeros, where % @var{padsize} defines the amount of padding to add in each dimension % (it must be a vector of positive integers). % % Each component of @var{padsize} defines the number of elements of % padding that will be added in the corresponding dimension. For % instance, [4,5] adds 4 elements of padding in first dimension (vertical) % and 5 in second dimension (horizontal). % % B = padarray(A,padsize,padval) pads @var{A} using the value specified % by @var{padval}. @var{padval} can be a scalar or a string. Possible % values are: % % @table @asis % @item 0 % Pads with 0 as described above. This is the default behaviour. % @item Scalar % Pads using @var{padval} as a padding value. % @item 'Circular' % Pads with a circular repetition of elements in @var{A} (similar to % tiling @var{A}). % @item 'Replicate' % Pads replicating values of @var{A} which are at the border of the % array. % @item 'Symmetric' % Pads with a mirror reflection of @var{A}. % @item 'Reflect' % Same as 'symmetric', but the borders are not used in the padding. % @end table % % B = padarray(A,padsize,padval,direction) pads @var{A} defining the % direction of the pad. Possible values are: % % @table @asis % @item 'Both' % For each dimension it pads before the first element the number % of elements defined by @var{padsize} and the same number again after % the last element. This is the default value. % @item 'Pre' % For each dimension it pads before the first element the number of % elements defined by @var{padsize}. % @item 'Post' % For each dimension it pads after the last element the number of % elements defined by @var{padsize}. % @end table % @end deftypefn