Search code examples
matrixoctaveinversion

How to inverse matrix and integer result in Octave?


I would like to get an invertible matrix in Octave but as integers matrix, so:

x = [9,15;19,2];
inv(x)

Here I get:

[-0.0074906, 0.0561798; 0.0711610, -0.0337079]

but I would like to get [22,17;25,21] anyone knows how to invert a matrix?


Solution

  • The inverse of each element is:

    x .^ -1
    

    Which results

    0.1111    0.0667
    0.0526    0.5000
    

    Why you want to get [22,17;25,21]? What mathematical operation would yield such result?