Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

clear all

clc
u=[-30 0 41.721];
two=rand(100,3);
[m,n] = size(two) ;
Error = abs(u-two) ;
square_Error = abs(u-two).^2 ;
for ii=1:m
MSE(ii) = norm((u-two(ii,:)).^2/m); %MSE = (u-two).^2/m ;
RMSE(ii) = sqrt((u - two(ii,:)).^2/m);
end
MSE=MSE';
RMSE=RMSE';
plot(ii,MSE,'r',ii,RMSE,'g')

u = [-30 0 41.721];
two = rand(100,3);
[m,n] = size(two);
MSE = mean((u-two).^2,2);
RMSE = sqrt(MSE);
x = 1:m;
plot(x,MSE,'r',x,RMSE,'g')

You might also like