
function example_inversa

format long e

A=[2 5 7; 1 5 2; 1 4 8];
[L,U,P]=lu(A);

y1=P'*[1; 0; 0];
z1=L\y1;
x1=U\z1



y2=P'*[0; 1; 0];
z2=L\y2;
x2=U\z2

y3=P'*[0; 0; 1];
z3=L\y3;
x3=U\z3

invA=[x1 x2 x3]
inv(A)
