Petr Schreiber
20-10-2011, 15:10
Second sample code for JOIN$ (titled "Example working on matrix") uses obsolete syntax, it should be the following.
Important note, possible bug?:
Although I use [ ] to force row order assignment, the output of JOIN$ looks like column order (1, 2, 3 is not in first row, but in first column).
This is not problem of row order assignment, but of JOIN$, but maybe I am missing something.
' Usage of the JOIN$ Keyword with matrix
Uses "console", "Math"
Dim MaxX As Long = 3
Dim MaxY As Long = 3
PrintL "Defining matrix a and b:", MaxX, "by", MaxY
Dim a(MaxX, MaxY) As Double
Dim b(MaxX, MaxY) As Double
PrintL "Filling matrix a with", Format$(MaxX * MaxY), "numbers"
a(1, 1) = [ 1, 0, 5,
2, 1, 6,
3, 4, 0 ]
PrintL "Inverting matrix a to b"
MAT b() = INV(a())
PrintL
PrintL "A is---------------------"
PrintL Join$(a, $TAB, $CRLF)
PrintL
PrintL "B is---------------------"
PrintL Join$(b, $TAB, $CRLF, " 00.0;-00.0; 00.0")
WaitKey
Petr
Important note, possible bug?:
Although I use [ ] to force row order assignment, the output of JOIN$ looks like column order (1, 2, 3 is not in first row, but in first column).
This is not problem of row order assignment, but of JOIN$, but maybe I am missing something.
' Usage of the JOIN$ Keyword with matrix
Uses "console", "Math"
Dim MaxX As Long = 3
Dim MaxY As Long = 3
PrintL "Defining matrix a and b:", MaxX, "by", MaxY
Dim a(MaxX, MaxY) As Double
Dim b(MaxX, MaxY) As Double
PrintL "Filling matrix a with", Format$(MaxX * MaxY), "numbers"
a(1, 1) = [ 1, 0, 5,
2, 1, 6,
3, 4, 0 ]
PrintL "Inverting matrix a to b"
MAT b() = INV(a())
PrintL
PrintL "A is---------------------"
PrintL Join$(a, $TAB, $CRLF)
PrintL
PrintL "B is---------------------"
PrintL Join$(b, $TAB, $CRLF, " 00.0;-00.0; 00.0")
WaitKey
Petr