disp('question 3)a)')
M =[ 1 1 1;
0 -1 1;
-2 1 0]
[L,U,P]=lu(M) //avec pivot partiel
disp('question 3)b)')
L=tril(sprand(10,10,0.2),-1)+eye(10,10);
U=triu(sprand(10,10,0.2),1)+eye(10,10);
disp('Le profil de LU (fig. 3) est réunion de ceux de L et U')
exec spy.sci;
subplot(2,2,1)
spy(L*U), xtitle('A=LU')
subplot(2,2,2)
spy(U), xtitle('U')
subplot(2,2,3)
spy(L), xtitle('L')