conv2

Compute 2D convolution.

Syntax

R = conv2(x,y)

R = conv2(col,row,m)

R = conv2(...,shape)

Inputs

x,y
Matrices to be convolved.
Type: double
Dimension: matrix
col,row
Vectors to convolve with m.
col is convolved with the columns of m.
row is convolved with the rows of m.
Type: double
Dimension: vector
m
Matrix to convolve with row and col.
Type: double
Dimension: matrix
shape
Options include:
'full' returns the full convolution (default). 'same' returns the central part of the convolution, returned matrix is the same size as x or m. 'valid' sets the return dimensions to max(size(x) - size(y) + 1, 0).
Type: string

Outputs

R
The convolution of the inputs.

Example

R = conv2([2,5,7,8,3,3,7,32,67,8,3,-763],[2,9,0,8,6],[6,8,3;9,0,5],'same')
R = [Matrix] 2 x 3
 576   876   862
2566  3219  3578