% grapple.m loads and displays grapple.gif, then performs median filtering G = imread('grapple.gif'); % read the .gif file class(G) % is G double or uint8? subplot(2,2,1) imshow(G,[0 1]); % display the image with 2 gray levels title('Original image') drawnow for i=1:3, G = medfilt2(G,[5 5]); subplot(2,2,i+1) imshow(G,[0 1]); title('After median filtering'); end