hello evreyone I need some help :)
here is my code. the error is in this line, line 16%maksimum=max(abs(U(i:end,i))); I used this matrix to test the code [1 2 3 4 1;2 4 6 8 2;3 6 9 12 3;4 8 12 16 4;8 6 4 2 8;4 3 2 1 4], the code works for some matrices but not for all. I want it to work like matlab's lu() function :) but it gave me some errors like "Index in position 2 exceeds array bounds. Index must not exceed 5."
disp('Matlab code for LU decomposition of a matrix using ''gaussian elimination''and ''partial pivoting''')
disp('Click Enter to continue.')
A = input("enter a matrix: ");
maksimum=max(abs(U(i:end,i)));
if maksimum == abs(U(k,i))
U(j,:) = U(j,:)-U(j,i)*U(i,:)/U(i,i);
disp('permutation matris(P):')
disp("A'in ust ucgen matris(U):")
disp("A'in alt ucgen matris(L):")