Help with LU factorization

Thank i got it now. as i know indmax Returns the index of the maximum element in a collection so when you said it’s now findmax i thought that it do the same thing but it seems that it returns the maximum element of the collection itr and its index.(not the index only)

Look at the documentation for findmax by typing ?findmax. You’ll see that it returns both the maximum value and the corresponding index. If you just want the index, do findmax(abs.(U[(k-1):n,k-1]))[2] or argmax(abs.(U[(k-1):n,k-1])).

In general, you should make some effort to read the documentation and debug things yourself before posting.