% script to find the gcd of a and b by the Euclidean algorithm, and to % report how many steps were required % This implementation requires a>0, b>0, so replace, if necessary, a=abs(a); b=abs(b); if(a0) q=floor(a/b); r=a-q*b; a=b; b=r; count=count+1; end a count