Multiplying and finding inverse of a matrix.
2 次查看(过去 30 天)
显示 更早的评论
I = [9; -3; 10; -10]
G = [0.3 0 -0.2 0; 0 0.25 -0.25 0; -0.2 -0.25 0.95 0; 0 0 0 0.05]
Invs(G)*I
0 个评论
回答(2 个)
Sam Chak
2023-11-18
Hi @Omar
Just wanted to share the three methods I sometimes use to compute the matrix inverse.
G = [0.3 0 -0.2 0;
0 0.25 -0.25 0;
-0.2 -0.25 0.95 0;
0 0 0 0.05]
%% Method 1: direct inverse function
inv(G)
%% Method 2: Matrix left division
G\eye(length(G))
%% Method 3: Reduced row echelon form
A = [G eye(length(G))];
R = rref(A)
iG = R(:,5:end)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Operating on Diagonal Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!