11 lines
326 B
Matlab
11 lines
326 B
Matlab
function mse = expdecaymse(t, x, tau)
|
|
% Mean squared error for a decaying exponential.
|
|
%
|
|
% Arguments: t, vector of time points.
|
|
% x, vector of the corresponding measured data values.
|
|
% tau, value for the time constant.
|
|
%
|
|
% Returns: mse: mean squared error
|
|
mse = mean((x - expdecay(t, tau)).^2);
|
|
end
|