How to calculate the inverse matrix in Matlab and Octave
To calculate the inverse matrix in Matlab / Octave use the inv() function.
The parameter m is an invertible matrix.
The function returns the inverse matrix.
What is inverse matrix? The inverse M-1 matrix of a square matrix M is a matrix such that the product M-1 M is equal to the identity matrix I
Given the following square matrix 3x3
Define the matrix in the Matlab/Octave variable X
>> X = [3 4 -1; 2 0 1; 1 3 -2]
To calculate the inverse matrix use the inv() function.
The function calculates and outputs the inverse matrix of X.
The result is assigned to the variable Y.
-0.60000 1.00000 0.80000
1.00000 -1.00000 -1.00000
1.20000 -1.00000 -1.60000
Each element is a real number.