You are here: Symbol Reference > MtxExprInt Namespace > Classes > VectorInt Record > public > VectorInt.Diag Method
MtxVec VCL
ContentsIndex
Example

In the following example we setup a matrix, populate it with values and then extract it's main diagonal to a vector.

var a: TVecInt; d: TMtxInt; begin CreateIt(a); CreateIt(d); try // setup matrix d.SetIt(2,2,[1,-2, 3, 4]); // get main diagonal from matrix a.Diag(d,0); // a now containes [1,4]; finally FreeIt(a); FreeIt(d); end; end;
Copyright (c) 1999-2025 by Dew Research. All rights reserved.