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

Copies values from vector to a matrix.

Pascal
function CopyVec(const Vec: TVec; NrRows: Integer): TMtx; overload;

Copy all Vec elements to the calling matrix. Set the calling matrix Rows property to NrRows. Set the calling matrix Cols property to Vec.Length div NrRow (Length = Rows*Cols). The calling matrix TMtxVec.ComplexComplexproperty is adjusted automatically. An exception is raised if Vec.Length mod NrRows <> 0.

var A: TMtx; v: TVec; begin CreateIt(A); Create(v); try v.SetIt(true,[1, 0, 2, -1, 5, 1.2]) ; A.CopyVec(v); finally FreeIt(A); end; end;
Examples on GitHub
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!