m = length(y); % number of training examples
J_history = zeros(num_iters, 1);
for iter = 1:num_iters
J_history(iter) = computeCost(X, y, theta);
h=sum(X*theta-y);
H=sum((X*theta-y).*X(:,2));
a=theta(1)-(alpha/num_iters)*h;
b=theta(2)-(alpha/num_iters)*H;
theta=[a;b];
end