帮忙写下均方误差mse的matlab的实现程序

非常感谢!!
2024-12-16 00:44:28
推荐回答(1个)
回答1:

function z=mse(x,y)
x=double(x);
y=double(y);
[m,n]=size(x);
z=0;
for i=1:m
for j=1:n
z=z+(x(i,j)-y(i,j)).^2;
end
end
z=z/(m*n);