# What is command for row echelon form of a matrix in MATLAB

663 views (last 30 days)
Ansha Nawaz on 21 Oct 2017
Commented: Nagabhushan SN on 19 Sep 2019
A = 3 -1 0 4 1 2 0 3 3 -1 >> ref(A) ??? Undefined function or method 'ref' for input arguments of type 'double'.

John D'Errico on 21 Oct 2017
Perhaps you are thinking of rref?
help rref
When you don't know the name of a function, learn to use lookfor. For example, when applied to the word "echelon", it returns this:
>> lookfor echelon
rref - Reduced row echelon form.
Ansha Nawaz on 21 Oct 2017
John D'Errico I have to apply Guass elimination,not Gauss-Jordan Elimination.
So, i just want echelon form not reduced echelon form

Nagabhushan SN on 9 Oct 2018
lu(A)
performs LU factorization of a matrix. So, you can get upper triangular matrix from there. Not sure though if it performs Gauss reduction
[L,U,P] = lu(A);
##### 2 CommentsShowHide 1 older comment
Nagabhushan SN on 19 Sep 2019
Hi Nathan, thanks for adding the details. Would help other people looking here.
And P is the permutation matrix. When you encounter a temporary breakdown when doing gauss elimination, you exchange the rows and proceed right, P captures that. In mathematical terms P*A = L*U