You are here: Symbol Reference > MtxVec Namespace > Classes > TMtx Class > public > Resize Method > TMtx.Resize Method (integer, integer)
MtxVec VCL
ContentsIndex
PreviousUpNext
TMtx.Resize Method (integer, integer)

Resizes the matrix, while preserving the values in already allocated memory.

Pascal
function Resize(NewRows: integer; NewCols: integer): TMtx; overload;

Sets the Rows property to NewRows, Cols property to NewCols, while preserving the values in already allocated memory.

var A,B: TMtx; begin CreateIt(A,B); try A.SetIt(2,2,False,[1,3, 2,4]); B.Resize(A,3,2,True); // B becomes: // [1,2,0, // 3,4,0]); finally FreeIt(A,B); end; end;
Examples on GitHub
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!