function ans=demo_det(A)
ans=0;[m,n]=size(A); 
     if m==1
         ans=A; return;
     end
     if m==2
    
     ans=A(1,1)*A(2,2)-A(1,2)*A(2,1); return; 
     end

     for i=1:n 
        B=[A(2:n,1:i-1) A(2:n,i+1:n)];    
        det_B=demo_det(B);      
        s=(-1)^(i+1); ans=ans+s*A(1,i)*det_B;
     end