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