# can you help me to fix my inverse matrix code?

Status
Not open for further replies.

#### darkhero

##### New member
VB.NET:
``````    r = InputBox("enter row")
c = InputBox("enter coloumns")
ReDim a(r, c)
ReDim trans(r, c)
ReDim Matrice(r, c)
ReDim Inverse_Matrix(r, c)
ReDim Operations_Matrix(r, c)
Print "mat is"
For i = 1 To r
For j = 1 To c
a(i, j) = InputBox("enter")
Print a(i, j); "      ";
Next
Print "         "
Next
Print "inverse is"

//the program wont print this

For j = 0 To c

trans(i, j) = trans(i, j)
If i <> j Then
a(i, j) = 0
Else
a(i, j) = 1
End If

Next
Next

Dim fak As Double

For j = 0 To c
trans(k, j) = trans(k, j) / fak
a(k, j) = a(k, j) / fak
Next

For i = 0 To c
If i <> k Then
fak = trans(i, k)
For j = 0 To c
trans(i, j) = trans(i, j) - fak * trans(k, j)
a(i, j) = a(i, j) - fak * a(k, j)
Next
End If
Next

Print a(i, j);``````
i dont know but the result dont came up , when i compile the program run but doesn't print the answer im so confused to solve this matrix code can just someone give me the algorithm ?

Last edited by a moderator:

#### jmcilhinney

##### VB.NET Forum Moderator
Staff member
I'm fairly certain that this is not VB.NET code. If I'm wrong then let me know but I suspect that it's VBA. Thread closed.

Status
Not open for further replies.

Replies
1
Views
261
Replies
1
Views
251
Replies
6
Views
332
Replies
3
Views
315
Replies
5
Views
4K