DataLab is a compact statistics package aiming at exploratory data analysis. Please visit the DataLab Web site for more information....


Resize (Matrix)

Declaration: TMatrix.Resize (NrCols, NrRows: integer): boolean;
The method Resize serves to change the dimensions of the matrix on the fly. The parameters Nc and Nr define the intended size of the matrix (number of columns and number of rows). Resize returns a TRUE value if the new matrix has been resized successfully.

Hint 1: Any excess matrix elements which are not covered by the original matrix are set to zero values.

Hint 2: Resizing a matrix allocates additional auxiliary memory in order to keep the existing cell values valid. If you don't need the values of a matrix and the matrix size is rather large, you are better off if you free the old matrix and create the new matrix from scratch.