diff --git a/ex1/computeCost.m b/ex1/computeCost.m index 4570dbb..170e3d1 100644 --- a/ex1/computeCost.m +++ b/ex1/computeCost.m @@ -19,7 +19,16 @@ % Instructions: Compute the cost of a particular choice of theta % You should set J to the cost. +% ====================== YOUR CODE HERE ====================== +% Instructions: Compute the cost of a particular choice of theta +% You should set J to the cost. +% sum = 0; +% temp_cost = X * theta - y; +% for i = 1:m +% sum = sum + temp_cost(i)^2; +% end +% J = (1/(2*m))*sum;