Matlab solution to Ax=b fails

3 ビュー (過去 30 日間)
Daniel Walsh
Daniel Walsh 2016 年 3 月 15 日
コメント済み: Daniel Walsh 2016 年 3 月 15 日
I have encountered the following problem: I need to solve a large linear system Ax=b, with complex, square A. I have imported A and b into Matlab from a file, and they are in Matlab's sparse matrix format. I then write x = A/b; and Matlab produces the solution for x. Now I check that the answer x satisfies the original equation: norm(A*x-transpose(b)); The transpose() has been applied to b because as far as I can tell Matlab returns x opposite to the mathematical convention (i.e. a row vector rather than a column vector).
When I run this check, the residual (norm of the difference) is on the order of 10^3, indicating that the solution is completely incorrect. Why is Matlab giving the wrong answer?
Any help would be appreciated, thank you.

採用された回答

Steven Lord
Steven Lord 2016 年 3 月 15 日
A/b ( MRDIVIDE ) and A\b ( MLDIVIDE ) are two different operations.
  1 件のコメント
Daniel Walsh
Daniel Walsh 2016 年 3 月 15 日
Yes, this was exactly the problem. Thank you for pointing that out.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLinear Algebra についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by