You are here: Symbol Reference > MtxExpr Namespace > Classes > Matrix Record > public > CopyVec Method > Matrix.CopyVec Method (TVec, Integer)
MtxVec VCL
ContentsIndex
PreviousUpNext
Matrix.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 Complex property is adjusted automatically. An exception is raised if Vec.Length mod NrRows <> 0.

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