IMatrixModelCoord.Item

Syntax

Item(DimIndex: Integer): Integer;

Parameters

DimIndex. Parameter number.

Description

The Item property determines index of the matrix element for the specified coordinate parameter.

Comments

The number of coordinate parameters corresponds to the number of dimensions in the matrix.

Example

Add a link to the MathFin system assembly.

Sub UserProc;
Var
    M: Matrix[2];
    Mm: IMatrixModel;
    I, J: Integer;
    Coord: IMatrixModelCoord;
Begin
    Debug.WriteLine("Source matrix");
    For i := 0 To 5 Do
        For j := 0 To 5 Do
            M[i, j] := Math.RandBetweenI(09);
        End For;
    End For;
    Mm := M As IMatrixModel;
    Coord := Mm.CreateModelCoord;
    Coord.Item(0) := Math.RandBetweenI(05);
    Coord.Item(1) := Math.RandBetweenI(05);
    Debug.WriteLine(Mm.Item(Coord));
End Sub UserProc;

After executing the example a matrix of random numbers is generated. The console displays the value of a matrix element with random coordinates.

See also:

IMatrixModelCoord