Yes, the sum of squares or the RMS:
SSq=sum(res.^2);
RMS=sqrt(mean(res.^2));
The downside of using the plain sum is that a large negative and a large positive will cancel out, which is clearly not what you want. Whether or not a number is large should not be a factor in your decision, just that you want to minimize it.
1 件のコメント
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/425795-calculate-residuals-as-a-single-number-in-lsqnonlin-function#comment_627319
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/425795-calculate-residuals-as-a-single-number-in-lsqnonlin-function#comment_627319
サインインしてコメントする。