function  u = recursion(a)

%This is a simple example of a for-loop in matlab.
%You should use this example to get started on the first homework.
%To use this, copy the file to your home directory, fire up matlab,
%change to the directory (cd) where you saved the file and type recursion(2)
%from a command prompt. 

u = a;

for i = 1:20
 u = (u + a/u)/2
%By omitting the semicolon on the previous line, the result will be printed
%each time we loop past this statement. 
end


