myinv function

Inverse of a matrix

Inverse of a matrix

This function returns the inverse or generalized inverse of a matrix.

myinv(A, type = "solve")

Arguments

  • A: A matrix to be inverted.
  • type: Type of matrix inversion, set to "solve" (default) or "ginv" (which can be used in the case of computational singularity).

Returns

The inverse of the given matrix A.