%Index columns, then rows, to check if there are any nonzero entries below the matrix(j,j) value
This code doesn't work properly; in addition, it seems very specific to what I'm trying to accomplish. Is there an easier way to sort through the rows to obtain upper triangular form while keeping the rows intact? The script I wrote transformed the matrix [1,-1,2,0,7;2,-2,2,-4,12;-1,1,-1,2,-4;-3,1,-8,-10,-29] into the above-referenced matrix. I now need to somehow swap rows or sort in order to obtain upper triangular form, and this is where I've tried various methods but am stuck. Thank you.