The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



Elem


Unit:SDL_matrix
Class: TMatrix, TIntMatrix, TMat3D
Declaration: property Elem[ix,iy: longint]: double; { class TMatrix }
property Elem[ix,iy: longint]: integer; { class TIntMatrix }
property Elem[ix,iy,iz: longint]: integer; { class TMat3D }

The property Elem is used to access a specific element of a matrix. The parameters and specify the indices (column and row) of the element to be accessed (starting with an index of 1). The parameter iz specifies the index of the layer (for three dimensional matrices of type TMat3D). If any of the indices is invalid (the valid range is determined by the parameters NrOfColumns, NrOfRows, and NrOfLayers (in the case of TMat3D)), Elem returns 0.0 (in case of a read operation), or the assignment is ignored (in case of a write operation).

Example: The statement Mat1.Elem[20,2]:=10.555; loads the matrix element of the 20th column and the second row with the value 10.555.

Example: This property is used in the following example programs (see http://www.lohninger.com/examples.html for downloading the code): cluster, covar, findcent, interpol3d, invmat, multilinreg, ntabedit



Last Update: 2023-Feb-10