I am asked to use conv2 to do the convolution of the red component of an image and a rectangle function but I get an error and I don't know how to handle it.
img = imread('test.png');
RED = img(:,:,1);
RECT = ones(10,1) / 10;
J= conv2(double(RED), RECT);
imagesc(J)
The error says Subscript indices must either be real positive integers or logicals.
Thanks