Problem using Left Hand Division in MATLAB

1 回表示 (過去 30 日間)
Michael
Michael 2014 年 10 月 16 日
コメント済み: Michael 2014 年 10 月 16 日
Hello Everyone,
I am currently working on trying to solve a System of Linear Equations, but MATLAB keeps on returning all zeroes. This is because all of the elements in the second matrix (on the answer side of the linear equations) are zeroes, but that is the only thing I am allowed to work with.
Here is the code:
--------------------------------------------------------
sysEq = [1/sqrt(35), -3/sqrt(34), 1/sqrt(42); 3/sqrt(35), 0, -4/sqrt(42); 5/sqrt(35), 5/sqrt(34), 5/sqrt(42)]
sysEqAns = [0, 0, 0]';
Ans = sysEq\sysEqAns
---------------------------------------------------------
If anyone knows how to resolve this complication, I'd be very grateful.
Thanks, Mike
  2 件のコメント
Guillaume
Guillaume 2014 年 10 月 16 日
Well, [0 0 0]' is obviously the solution to your particular set of linear equations, so I'm not sure what else you're hoping to get.
I don't particularly understand your comment 'that is the only thing I am allowed to work with'. If your constants are not zero, obviously don't set them as 0, otherwise you'll never get the right answer.
Finally, as an aside, I wouldn't call my variable Ans, it's a bit too close to matlab built-in variable ans.
Mischa Kim
Mischa Kim 2014 年 10 月 16 日
Not that obvious. For a rank-deficient matrix there are an inifinte number of non-zero solution vectors.

サインインしてコメントする。

採用された回答

Mischa Kim
Mischa Kim 2014 年 10 月 16 日
編集済み: Mischa Kim 2014 年 10 月 16 日
Michael, the answer (zero-vector) is correct. If you do
rank(sysEq)
you'll see that the matrix has full rank (= 3). This means that the rows (and columns) of the matrix are linearly independent which in turn means that only Ans = [0 0 0]' multiplied by the matrix will result in the zero-vector sysEqAns = [0 0 0]'. In other words, there is no other solution for Ans that results in the zero-vector for sysEqAns.
  1 件のコメント
Michael
Michael 2014 年 10 月 16 日
Thank you Mischa

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by