You can apply horizontal and vertical filtering separately .
v = fspecial( 'gaussian', [11 1], 5 ); % vertical filter h = fspecial( 'gaussian', [1 5], 2 ); % horizontal img = imfilter( imfilter( img, h, 'symmetric' ), v, 'symmetric' );
In addition, you can βcomposeβ two filters using an external product
f = v * h; % this is NOT a dot product - this returns a matrix! img = imfilter( img, f, 'symmetric' );
PS
if you are looking for directional filtering you might consider fspecial('motion'...)
source share