padarray
B = padarray(A, padsize; padval=nothing)Pad matrix A with an amount of padding in each dimension specified by padsize.
Args
Kwargs
padval: If not specified,Ais padded with a replication of the first/last row and column, otherwisepadvalspecifies a constant value to use for padded elements.padvalcan take the value -Inf or Inf, in which case the smallest or largest representable value of the type ofAis used, respectively.
Return
Padded array of same type as input.
Example
A = [1 2; 3 4];
B = padarray(A,1)
4×4 Matrix{Int64}:
1 1 2 2
1 1 2 2
3 3 4 4
3 3 4 4