필터 지우기
필터 지우기

problem with rref function

조회 수: 9 (최근 30일)
Sudipta Sinha
Sudipta Sinha 2014년 5월 22일
댓글: Sudipta Sinha 2014년 5월 22일
Hi All,
I was trying to solve a set of linear equations by using rref function. My matrix is a rectangular positive definite and the explicit form of the matrices are attached with this message. However, the rref works fine with matrix1 but it doesn't work for matrix2. The only change between the two matrices is at (13,23) element (68.4900 vs 61.6410). the matrix2 only gives bunch of 0.0s as solution. But my interest to get the numbers from the matrix2. How should i proceed? or where is my wrong.
Any comments will be highly appreciated
Thanks in advance
Sudipta
  댓글 수: 2
John D'Errico
John D'Errico 2014년 5월 22일
편집: John D'Errico 2014년 5월 22일
I know that you THINK you have given us the matrices in question, but you have not, unless that is EXACTLY as those numbers were entered into MATLAB. You have probably provided 7 digit approximations to those matrices. As such, those matrices would be useless as is.
Matt J
Matt J 2014년 5월 22일
So, if you want to give us the matrices, attach them in a .mat file.

댓글을 달려면 로그인하십시오.

채택된 답변

Matt J
Matt J 2014년 5월 22일
You should be using mldivide(), not rref().
  댓글 수: 2
Sudipta Sinha
Sudipta Sinha 2014년 5월 22일
thanks for advise. any clue why rref doesn't work
Sudipta Sinha
Sudipta Sinha 2014년 5월 22일
the function mldivide() doesn't work. It produces inf and NAN. I changed the number 68.49 to 68.48 instead of changing 61.64. Still it gives some error, like matrix is close to singular and produces inf and NAN. Please advise me what should I do to solve this issue.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

John D'Errico
John D'Errico 2014년 5월 22일
FURTHERMORE ... while you claim that matrix 1 is positive definite, it is a 22x23 matrix. Positive definite it is not.
By definition, a positive definite matrix is square. Time for some reading on your part.
Finally, lets look at Matrix1, AS you have given it to us.
svd(Matrix1)
ans =
5180
896.72
896.4
366.59
283.26
1
1
1
1
0.99998
0.99998
0.81686
0.81613
0.57785
0.57773
0.57772
0.57699
0.57698
0.57687
4.8302e-05
3.5355e-05
1.7948e-14
See that little number at the end? That tells me that your matrix is actually numerically singular as you have provided it.
rank(Matrix1)
ans =
21
When you changed one element, it was no longer numerically singular. In fact, it had rank 22.
rank(Matrix2)
ans =
22
Sorry, but it is time for you to re-read those linear algebra notes.
  댓글 수: 2
Sudipta Sinha
Sudipta Sinha 2014년 5월 22일
Yes, you are right. Actually there is no gurentee that those two matrices are positive and definite. But actually the 15X15 matrix is positive and definite but the overall matrix is not.
Please advise me how do i convert the singular to nonsingular matrix. or is there any other function or method that i can use for that.
Sudipta Sinha
Sudipta Sinha 2014년 5월 22일
please advise me how to avoid singularity and also I want to use rref function.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Linear Equations에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by