function d = mydet (A)
n = length (A) ;
if n==1
    d = A( 1 , 1 ) ;
else
    d = 0 ;
    sig = 1 ;
    for i =1:n
        d = d + sig*A(1,i)*mydet(A(2:n,[1:i-1,i+1:n]));
        sig = -sig ;
    end
end