I have been trying to do Gauss jordan method in matrices in octave, and I have found diferent ways to call the function, but none works. How can I do that?
A=[1 -2 -1; -1 1 1; 1 1 5]
B=[1; 4; -3]
#format rat
#Transposta = transpose(A) #Transposta
#Inversa = inv(A) #Inversa
#Adjunta = det(A)*inv(A) #Adjunta se A tiver inversa
determinante = det(A) #Determinante.
Resultado = Gaussian(A)
CodePudding user response:
Use the rref
function...
A = [1 -2 -1; -1 1 1; 1 1 5]
B = [1; 4; -3]
C = [A, B]
[a, b] = rref(C)
Result
a = 1.0000 0 0 -7.1667
0 1.0000 0 -5.0000
0 0 1.0000 1.8333
More Info: https://docs.octave.org/v7.3.0/Basic-Matrix-Functions.html