Results 1 to 3 of 3

Thread: Help file: JOIN$ sample

  1. #1
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Help file: JOIN$ sample

    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
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    Example amended.

    The problem is that JOIN$ does not anything about how the matrix is filled because row/column assignment is not saved into matrix. And row/column assignment can change at every assignment.

    I have to think about how to solve this problem, maybe setting row/column as a characteristic of the matrix.

    Opened a feature request: http://www.thinbasic.com/community/p...hp?issueid=326
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  3. #3
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732
    Hi Eros,

    maybe it is problem just in my head - in matrix calculus, the first index is row and second column.
    But when working with 2D array, I think most people think of the first index as "x" (=column) and second "y" (=row).


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

Similar Threads

  1. JOIN$ with matrix
    By ErosOlmi in forum thinBasic vaporware
    Replies: 0
    Last Post: 03-07-2010, 12:04

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •