12 lines
347 B
Matlab
12 lines
347 B
Matlab
function mse = meanSquaredError(x, y, c)
|
|
% Mean squared error between data pairs and a cubic relation.
|
|
%
|
|
% Arguments: x, vector of the input values
|
|
% y, vector of the corresponding measured output values
|
|
% c, the factor for the cubic relation.
|
|
%
|
|
% Returns: mse, the mean-squared-error.
|
|
|
|
mse = mean((y - c*x.^3).^2);
|
|
end
|