IMath.MMult

Syntax

MMult(A1: Array; A2: Array): Array;

Parameters

A1. Array of real numbers.

A2. Array of real numbers.

Description

The MMult method returns a product of set matrices.

Comments

The resulting array will have the same number of rows as A1 and the same number of columns as A2.

The number of columns of A1 argument must be the same as the number of rows of A2 argument.

Example

To execute this example, add a link to the Stat system assembly.

Sub UserProc;
Var
    MM, matr1, matr2: Array Of Double;
    i, j: Integer;
Begin
    matr1 := New Double[33];
    matr1[00] := 1; matr1[01] := 9; matr1[02] := 9;
    matr1[10] := 2; matr1[11] := 15; matr1[12] := 4;
    matr1[20] := 8; matr1[21] := 1; matr1[22] := 13;
    matr2 := New Double[32];
    matr2[00] := 10; matr2[01] := 3;
    matr2[10] := 20; matr2[11] := 16;
    matr2[20] := 18; matr2[21] := 17
    MM := Math.MMult(matr1,matr2);
    If math.Status = 0 Then
        For i := 0 To MM.GetUpperBound(1Do
            For j := 0 To MM.GetUpperBound(2Do
                Debug.Write(MM[i, j].ToString + " ");
            End For;
            Debug.WriteLine("");
        End For;
        Else
        Debug.WriteLine("Error " + Math.Status.ToString + ": " + Math.ErrorMsg);   
    End If;
End Sub UserProc;

After executing the example the console window displays the matrix that is equal to the product of set matrices.

See also:

IMath