How can I generate reciprocal of a matrix
80 ビュー (過去 30 日間)
古いコメントを表示
I have big matrix A 500 by 500 and I want to generate reciprocal of matrix A
what caluclation shuould I do or is there a function in matlab that I can use
%Matrix A
A = [2, 3, -1, 5; -1, 4, -7, -3; -6, 0, 3, 9; 7, 6, -3, 8];
%Matrix X, reciprocal of matrix A
X= ....
0 件のコメント
採用された回答
Star Strider
2019 年 4 月 19 日
It depends on what you mean by ‘reciprocal’. If you want ‘X’ such that:
A*X = eye(size(A,1))
then:
X1 = inv(A); % Inverse
X2 = pinv(A); % Pseudo-Inverse
will do what you want.
There are many precautions about calculating the inverse that you will likely encounter. A much better option would be to use the mldivide,\ (link) function if you want to solve linear systems, for example.
0 件のコメント
その他の回答 (1 件)
Walter Roberson
2019 年 4 月 19 日
I suspect that you want inv(A) but possibly you want 1./A
In most cases inv() is better avoided in favor of using the \ operator or decomposition
2 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!