diff --git a/matlab/trust_region.m b/matlab/trust_region.m index 08fb6c9c8..5069a37df 100644 --- a/matlab/trust_region.m +++ b/matlab/trust_region.m @@ -188,7 +188,7 @@ end function x = dogleg (r, b, d, delta) % Get Gauss-Newton direction. -x = r \ b; +x = decomposition(r, 'CheckCondition', false) \ b; xn = norm (d .* x); if (xn > delta) % GN is too big, get scaled gradient. @@ -218,3 +218,4 @@ if (xn > delta) x = alpha * x + ((1-alpha) * min (snm, delta)) * s; end end +