Gauss-Jordan matrix inversion: Difference between revisions

no edit summary
(Added implementation for Rust)
No edit summary
Line 2,069:
[-0.05555555555555555,0.1111111111111111,-0.05555555555555555]]
</lang>
 
=={{header|Mathematica}} / {{header|Wolfram Language}}==
<lang Mathematica>a = N@{{1, 7, 5, 0}, {5, 8, 6, 9}, {2, 1, 6, 4}, {8, 1, 2, 4}};
elimmat = RowReduce[Join[a, IdentityMatrix[Length[a]], 2]];
inv = elimmat[[All, -Length[a] ;;]]</lang>
{{out}}
<pre>{{0.0463243, -0.0563948, -0.0367573, 0.163646}, {0.0866062, 0.0684794, -0.133938, -0.020141}, {0.0694864, -0.0845921, 0.194864, -0.00453172}, {-0.149043, 0.137966, 0.00956697, -0.0699899}}</pre>
 
=={{header|MATLAB}}==
1,111

edits