Vectorized gradient descent in costFunction.m