Dim matrix(0 To 1, 0 To 2) As Double
Dim trans As Variant
Dim i As Integer, j As Integer
Dim s As String
matrix(0,0) = 56.23
matrix(0,1) = 7.87
matrix(0,2) = 65.12
matrix(1,0) = 876.23
matrix(1,1) = 3.42
matrix(1,2) = 87.55
trans = CNCL_MatrixTrans(matrix)
Print "Vorgegebene Matrix"
For i = LBound(matrix,1) To UBound(matrix,1)
s = ""
For j = LBound(matrix,2) To UBound(matrix,2)
s = s + CStr(matrix(i,j)) + " "
Next
Print s
Next
Print "Transponierte Matrix"
For i = LBound(trans,1) To UBound(trans,1)
s = ""
For j = LBound(trans,2) To UBound(trans,2)
s = s + CStr(trans(i,j)) + " "
Next
Print s
Next
Ausgabe:
Vorgegebene Matrix
56.23 7.87 65.12
876.23 3.42 87.55
Transponierte Matrix
56.23 876.23
7.87 3.42
65.12 87.55