Returns a one-row matrix (horizontal vector) using one row of current matrix object.
MatrixObject.RowVector(RowIndex)
A reference to the one-column matrix.
Error 1319 is returned if RowIndex exceeds matrix size.
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
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 |