Include File STB.svx and Statistica Visual Basic Library of Matrix Functions
The include file STB.svx includes various interfaces to (1) the STB library of matrix functions and (2) various spreadsheet functions that were included in Statistica Version 5 to manage scrollsheets (which were the output documents used in Statistica Version 5; see also Include file Graphics.svx); these ("old-style") scrollsheet functions are provided for backward compatibility (with Version 5) only (note that the current version's data spreadsheet functions are much more general, powerful, and usually easier to use).
Therefore, in order to access any of the functions of, for example, the STB Visual Basic library of matrix functions, you must include the file STB.svx at the beginning of the file:
'$include: "*STB.svx"
' This program will now have access to all
' functions of the Statistica Visual Basic
' library of matrix functions.
Sub Main
....
....
An example of a complete program is also provided below.
The following example illustrates how to use the functions in the Statistica library of matrix functions to perform some basic matrix operations, namely, matrix inversion and matrix multiplication:
' The following line is very important!
' It contains the "interfaces" to the Statistica
' Matrix and Statistical Function libraries. Note
' that we are using the "asterisk" (*) convention to
' direct the program to "look for" file STB.svx
' in the current installation of Statistica; this
' ensures portability of code from one machine
' (installation of Statistica) to another.
'$include: "*STB.svx"
' The next statement will cause all arrays to be
' declared by default as 1-referenced, i.e., the
' first element in an array will be element 1, not 0.
Option Base 1
Sub Main
Dim a(4,4) As Double, ainv(4,4) As Double
Dim i As Long, j As Long
For i=1 To 4
For j=1 To 4
a(i,j)=Rnd(10)
Next j
Next i
MatrixDisplay (a, "Original Matrix A")
MatrixInverse(a,ainv)
MatrixDisplay (ainv, "A, Inverse")
End Sub