VOOZH about

URL: https://www.geeksforgeeks.org/r-language/finding-inverse-of-a-matrix-in-r-programming-inv-function/

⇱ Finding Inverse of a Matrix in R Programming - inv() Function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Finding Inverse of a Matrix in R Programming - inv() Function

Last Updated : 15 Jul, 2025
inv() function in R Language is used to calculate inverse of a matrix.
Note: Determinant of the matrix must not be zero
Syntax: inv(x) Parameters: x: Matrix
Example 1: Output:
 [, 1] [, 2] [, 3]
[1, ] -0.2857143 -0.2857143 0.7142857
[2, ] 0.5000000 1.0000000 -1.5000000
[3, ] 0.1071429 -0.1428571 0.1071429
Example 2: Output:
[1] -46
Inverse of A:
 [, 1] [, 2] [, 3]
[1, ] -0.3043478 0.08695652 0.3913044
[2, ] 0.2391304 0.21739130 -0.5217391
[3, ] 0.1086957 -0.17391304 0.2173913
Comment
Article Tags:

Explore