ProductName  

Returns / sets a single element of the current matrix.

Syntax

MatrixObject.Item(RowIndex, ColIndex) = Value
Value = MatrixObject.Item(RowIndex, ColIndex) 

Property Value

Read / write. A Double value if matrix is real, or a Complex value if matrix is a complex matrix.

Parameters

RowIndex
Long integer specifying the row containing the matrix element you want to return or to set.
ColIndex
Long integer specifying the column containing the matrix element you want to return or to set.
Value
A Double value if matrix is a real matrix or a Complex value for a complex matrix.

Remarks

This is the default property of the matrix object, so you don't have to refer explicitly to the property when setting or retrieving its value. Any of the following statements are valid.

M.Item(0, 0) = 1.1
a = M.Item(0, 0)

' Item property can be omitted
M(0, 0) = 1.1
a = M(0, 0)

Item property is zero based. Upper left most element is MatrixObject.Item(0, 0) and lower right most element is MatrixObject.Item(MatrixObject.Rows - 1, MatrixObject.Cols - 1).

Error Codes

Error 1319 is returned if RowIndex parameter points to an element outside matrix bounds.

Error 1320 is returned if ColIndex parameter points to an element outside matrix bounds.

See Also

Applies To: Matrix | CMatrix