You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fminFun = @(params) mean(abs(yNoisy - (params(1)*x + params(2)))); % We need to set this one up so that the correct values get us as close to 0 as possible.
fminParams = fminsearch(fminFun,initialGuess);
fminLine = fminParams(1)*x + fminParams(2);
toc
% Plot the data and both fit attempts, as well as the noiseless line