MATLAB Answers

why computeCost function shows incorrect dimension error in second call?

1 view (last 30 days)
Tshering Lhamo
Tshering Lhamo on 8 Sep 2020
h = X * theta;
sq_error = (h - y) .^ 2;
J = 1/(2*m) * sum(sq_error);
correcting the code with error message shows error in first call too.


Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!