Mat Inv Command

Purpose

Calculates an inverse of a two-dimensional floating point array which is interpreted as a matrix.

Syntax

Mat Inv a()=b()

a(),b():names of two-dimensional floating point arrays with the same number of rows and columns.

Description

Mat Inv a()=b() returns the inverse of a square matrix. The inverse of matrix b() is written to matrix a(). a() must, therefore, be of the same type as b().

Example

Data 2,4.5,6,3.2,7,1.7,-4,12

Data -3,5,9,-2.1,6,9,11,3

Data 11.4,2.3,6,3.2,6,1.2,-5,7

Data 3,5,6,8.2,4.1,-5.2,6.2,7.9

Data 1,2.3,9,8.1,0,4.2,5,3.7

Data 4.2,7.1,8.3,9.1,-5,-3,-1,0

Data 2.0,3,9.1,0,0,7.1,-3,8.8

Data 2.1,9,3.3,4,5,-1,-2,0

OpenW # 1

Global Double a(1 .. 8, 1 .. 8)

Global Double b(1 .. 8, 1 .. 8)

Global Double c(1 .. 8, 1 .. 8)

Global Double d(1 .. 8, 1 .. 8), a%

Mat Read b()

Mat Print b(), 6, 3

Print

Print "Inverse:"

Print

Mat Inv a() = b() //calculate the inverse

Mat Print a(), 6, 3

Print

Print "Press any key"

KeyGet a%

Cls

Print "Original matrix * Inverse "

Print

Mat Mul d() = b() * a()

Mat Print d(), 6, 3

See Also

Mat Det, Mat QDet, Mat Rank

{Created by Sjouke Hamstra; Last updated: 14/10/2014 by James Gaite}