You are looping over j, but nothing in your equation is changing with respect to j. Only after all the j's are finished and i changes does your value change. The values are repeating hsteps times (100) before changing.
To see what's happening, just replace line 18 with
theta_new(i,j) = theta_initial + dtheta(i);
and look at the theta_new matrix. Basically, the way you have this set up, there is no reason to have two loops since one is just repeating the same calculation 100 times.