Ich hätte da gerne mal ein Problem!
Auf dem Blatt kann ich die Gleichungssysteme ausrechnen aber in PB weis ich halt nicht wie das ganze aussehen soll.
Hätte da jemand einen Tipp für mich?
THx MJP
Code: Alles auswählen
Procedure GaussSolve(*Matrix.l, N.l)
Protected N, h.f, i, j, k, *Matrix, *Matrix0
N = N - 1
Dim __matrix.f(N, N - 1)
*Matrix0 = @__matrix()
__matrix() = *Matrix
For i = 0 To N - 1
h = __matrix(i, i)
If h = 0
__matrix() = *Matrix0
Dim __matrix.f(0, 0)
ProcedureReturn 0
EndIf
For j = 0 To N
__matrix(j, i) = __matrix(j, i) / h
Next
For j = 0 To N - 1
If i <> j
h = __matrix(i, j)
For k = 0 To N
__matrix(k, j) = __matrix(k, j) - __matrix(k, i) * h
Next
EndIf
Next
Next
__matrix() = *Matrix0
Dim __matrix.f(0, 0)
ProcedureReturn 1
EndProcedure
#x = 3
#y = 2
Dim Matrix.f(#x - 1, #y - 1)
For y = 0 To #y - 1
For x = 0 To #x - 1
Read Matrix(x, y)
Next
Next
GaussSolve(@Matrix(), #x)
line.s
For y = 0 To #y - 1
For x = 0 To #x - 1
line + StrF(Matrix(x, y)) + " "
Next
Debug line
line = ""
Next
DataSection
matrix:
Data.f 7, 2, 3
Data.f 8, 3, 9
EndDataSection