<< moc_conv Matlab/Octave Compatibility toolbox moc_corr >>

Matlab/Octave Compatibility toolbox >> Matlab/Octave Compatibility toolbox > moc_conv2

moc_conv2

performs 2D convolution of matrices a and b

Calling Sequence

c = moc_conv2( a, b )
c = moc_conv2( a, b, shape )

Parameters

c :

2D convolution of matrices a and b

shape:

'full' :

(defalut) returns full 2D convolution

'same' :

returns central part that is same size as a

'valid' :

returns only those parts of the convolution that are computed without the zero-padded edges

Description

conv2 is most efficient when size(a) > size(b)

Examples

A = rand(3,3);
B = rand(4,4);
C = moc_conv2(A,B)
Cs = moc_conv2(A,B,'same')

s = [1 2 1; 0 0 0; -1 -2 -1];
A = zeros(10,10);
A(3:7,3:7) = ones(5,5);
H = moc_conv2(A,s);
mesh(H)

Report an issue
<< moc_conv Matlab/Octave Compatibility toolbox moc_corr >>