# Gilbert-Peierls algorithm for LU Decomposition

I searched for Gilbert-Peierls algorithm, but I haven't found anything useful (well, I found this, but it's not working as it should). I think the problem is the second part, and also that those lines:

U(1:k, k) = x(1:k);
L(k:N, k) = x(k:N)/U(k, k);


should actually be (according to this example):

U(1:N, k) = x(1:N);
L(k:N, k) = x(k:N)/U(k, k);


Also, in that example, L is the identity matrix, which I find a bit strange. Could someone describe the algorithm, please? (with or without code)