diff --git a/mlclass-ex2-005/mlclass-ex2/costFunctionReg.m b/mlclass-ex2-005/mlclass-ex2/costFunctionReg.m index 0710790..7605e7c 100644 --- a/mlclass-ex2-005/mlclass-ex2/costFunctionReg.m +++ b/mlclass-ex2-005/mlclass-ex2/costFunctionReg.m @@ -24,7 +24,7 @@ theta_zeroed_first = [0; theta(2:length(theta));]; J = J + lambda / (2 * m) * sum( theta_zeroed_first .^ 2 ); -grad = grad .+ (lambda / m) * theta_zeroed_first; +grad = grad + (lambda / m) * theta_zeroed_first; % =============================================================