Skip to main content

rmsError.m


% This function is part of the NMSM Pipeline, see file for full license.
%
% This function takes a value and an expected value and returns the RMS
% error between them.
%
% (number, number) -> (number)
% Returns the RMS error for the given values


function output = rmsError(value, expected)
total = 0;
for i=1:length(expected)
total = total + (expected(i)-value(i))^2;
end
output = sqrt(total/length(expected));
end