The following macro, INVERSE.PCM, will find the inverse of a square matrix. If you have a square matrix M, you could find it's inverse, INV_M, with the command: @INVERSE M if ( vlen(?1)[1] "NE" vlen(?1)[2] ) then display `input matrix must be square' return endif n = vlen(?1)[1] ! identity(n) is the identity matrix of order n do k = [1:n] inv_m[1:n,k] = gaussj(?1,identity(n)[1:n,k]) enddo