%% Square root with Newton's method using for-loop. 
a = 5;
N = 6;
x = zeros(N,1); % Allocate column vector.
x(1)=a;
for k = 1:N
    x(k+1)  = 0.5*(x(k)+ a/x(k))
end
T = [(0:N)' x sqrt(a)-x]

