% EX 3: 
%  fonction Profil
% -----------------
function [pL,pC] = Profil(A)
N = size(A,1);
pL=zeros(N,1);
pC=zeros(N,1);
for I = 1:N
%  ou  find(A(I,:),1)
   if find(A(I,:),1) < N+1 
         pL(I) = find(A(I,:),1);
   else
         pL(I) = N+1;
   end
%   pL(I) = min(find(A(I,:)))
   if find(A(:,I),1) < N+1 
         pC(I) = find(A(:,I),1);
   else
         pC(I) = N+1;
   end
end