What is command for row echelon form of a matrix in MATLAB
189 ビュー (過去 30 日間)
古いコメントを表示
A = 3 -1 0 4 1 2 0 3 3 -1 >> ref(A) ??? Undefined function or method 'ref' for input arguments of type 'double'.
0 件のコメント
採用された回答
John D'Errico
2017 年 10 月 21 日
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.
その他の回答 (1 件)
Nagabhushan SN
2018 年 10 月 9 日
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 件のコメント
Nathan Cleavinger
2019 年 9 月 19 日
Thanks, Nagabhushan.
I had the same question, and that's exatly what I needed.
U = upper matrix (which is the ref - what we really want)
L = lower matrix, which is the coefficients used to eliminate elements
(i.e. to eliminate the first element on the second row, we'd used
(E2 - m21* E1) -> E2
and L stores all of the m__ coefficients. This is helpful when using other methods to solve matrices)
I'm not sure what P does.
Nagabhushan SN
2019 年 9 月 19 日
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
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!