IMatrixModelCoord.Item

Syntax

Item(DimIndex: Integer): Integer;

Parameters

DimIndex - parameter number. The number of coordinate parameters corresponds to the number of matrix dimensions.

Description

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

Example

Sub Main;

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(0, 9);

End For;

End For;

Mm := M As IMatrixModel;

Coord := Mm.CreateModelCoord;

Coord.Item(0) := Math.RandBetweenI(0, 5);

Coord.Item(1) := Math.RandBetweenI(0, 5);

Debug.WriteLine(Mm.Item(Coord));

End Sub Main;

After executing the example a matrix of random numbers will be generated. The value of a matrix element with random coordinates will be displayed.

See also:

IMatrixModelCoord