Returns a one-column matrix (vertical vector) using one column of the current matrix object.
MatrixObject.ColVector(ColIndex)
A reference to the one-column matrix.
Error 1320 will be returned, if ColIndex exceeds matrix size.
This example demonstrates the use of the ColVector and RowVector methods.
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 |