Simultaneously sets both the number of rows and columns of the current matrix object.
MatrixObject.Size NumOfRows, NumOfCols
You can either use Size method or set both Rows and Cols properties, in order to size a matrix.
When a matrix is first sized all its elements are set to 0. Resizing a matrix preserves its previous data.
Error 1301 is returned if NumOfRows parameter is less than 1 or greater than MaxSize property.
Error 1302 is returned if NumOfCols parameter is less than 1 or greater than MaxSize property.
This example demonstrates the use of the Size method.
Private Sub MatrixSize()
Dim A As Matrix
Set A = New Matrix
A.Size 3, 3
A.FillRandom
Debug.Print A.GetString
A.Size 4, 4
Debug.Print A.GetString
End Sub
| 6.000 2.000 8.000 | | 6.000 5.000 4.000 | | 9.000 8.000 7.000 | | 6.000 2.000 8.000 0.000 | | 6.000 5.000 4.000 0.000 | | 9.000 8.000 7.000 0.000 | | 0.000 0.000 0.000 0.000 |
Cholesky Method | QR method | SVD Method