ProductName  

Returns a one-row matrix (horizontal vector) using one row of current matrix object.

Syntax

MatrixObject.RowVector(RowIndex)

Return Value

A reference to the one-column matrix.

Parameters

RowIndex
Optional. A Long integer specifying the row you want to return as a vector. The default value is 0 (the first row).

Error Codes

Error 1319 is returned if RowIndex exceeds matrix size.

Example

This example demonstrates the use of ColVector and RowVector method.

Private Sub MatrixToVector()

Dim A As New Matrix
Dim CV As Matrix, RV As Matrix

    A.Size 5, 3
    A.FillRandom
    Debug.Print "A="
    Debug.Print A.GetString

    Set RV = A.RowVector(3)
    Debug.Print "Row Vector using row# 3"
    Debug.Print "RV="
    Debug.Print RV.GetString

    Set CV = A.ColVector(2)
    Debug.Print "Column Vector using column# 2"
    Debug.Print "CV="
    Debug.Print CV.GetString

End Sub

Output

A=
| 7,000 5,000 6,000 |
| 3,000 3,000 8,000 |
| 0,000 8,000 8,000 |
| 7,000 0,000 4,000 |
| 9,000 8,000 4,000 |

Row Vector using row# 3
RV=
| 7,000 0,000 4,000 |

Column Vector using column# 2
CV=
| 6,000 |
| 8,000 |
| 8,000 |
| 4,000 |
| 4,000 |

See Also

ColVector Method

Applies To: Matrix | CMatrix