Hmh. Well. I don't know what to do with this on the forum, so I'll just attach it. Both files have been fixed. Here's a short extract:
% read an image
inpict = imread('cameraman.tif');
% add gaussian noise
G = imnoise(inpict,'gaussian',0, 0.005);
% calculate error of noisy image
GaussianMSE = immse(inpict,G)
% Average filter
averagefilter = fspecial('average',3);
averageG = imfilter(G,averagefilter,'replicate');
G_MSE_average = immse(inpict,averageG)
% Adaptive filter
tau = 0.25;
adaptiveG = adaptfilter(G,tau);
G_MSE_adaptive = immse(inpict,adaptiveG)
% Median filter
medianG = medfilt2(G,[3 3]);
G_MSE_median = immse(inpict,medianG)