1function [jVal, gradient] = costFunction(theta) 2jVal = (theta(1)-5).^2 + (theta(2)-5).^2; 3gradient = zeros(2,1); 4gradient(1) = 2*((theta(1)- 5)); 5gradient(2) = 2*((theta(2)- 5)); 6