This repository has been archived on 2021-05-17. You can view files and clone it, but cannot push or open issues or pull requests.
scientificComputing/projects/project_input_resistance/solution/lsqError.m

13 lines
448 B
Matlab

function error = lsqError(parameter, x, y)
% Objective function for fitting a exponential equation to data.
%
% Arguments: parameter, vector containing the parameters for the exp. decay
% x, vector of the input values
% y, vector of the corresponding measured output values
%
% Returns: the estimation error in terms of the mean sqaure error
y_est = exponentialDecay(parameter, x);
error = meanSquareError(y, y_est);
end