Copy - Maple Help

# Online Help

###### All Products    Maple    MapleSim

LinearAlgebra

 Copy
 construct a copy of a Matrix or Vector

 Calling Sequence Copy(MV)

Parameters

 MV - Matrix or Vector to copy

Description

 • The Copy(MV) command returns an identical copy of its argument, MV.  Because this copy is not simply another reference to MV, changes to MV or to the copy do not affect the other.

Examples

 > $\mathrm{with}\left(\mathrm{LinearAlgebra}\right):$
 > $v≔\mathrm{Vector}\left[\mathrm{row}\right]\left(\left[1,2,3\right],\mathrm{datatype}=\mathrm{float}\left[8\right],\mathrm{attributes}=\left[\mathrm{blue}\right]\right)$
 ${v}{≔}\left[\begin{array}{ccc}{1.}& {2.}& {3.}\end{array}\right]$ (1)
 > $w≔\mathrm{Copy}\left(v\right)$
 ${w}{≔}\left[\begin{array}{ccc}{1.}& {2.}& {3.}\end{array}\right]$ (2)
 > $\mathrm{attributes}\left(w\right)$
 ${\mathrm{blue}}$ (3)
 > $w\left[1\right]≔10:$
 > $v\left[1\right]$
 ${1.}$ (4)
 > $M≔\mathrm{Matrix}\left(\left[\left[1,2,3\right],\left[4,5\right],\left[6\right]\right],\mathrm{scan}=\mathrm{triangular}\left[\mathrm{upper}\right],\mathrm{shape}=\mathrm{triangular}\left[\mathrm{upper}\right]\right)$
 ${M}{≔}\left[\begin{array}{ccc}{1}& {2}& {3}\\ {0}& {4}& {5}\\ {0}& {0}& {6}\end{array}\right]$ (5)
 > $N≔\mathrm{Matrix}\left(M\right)$
 ${N}{≔}\left[\begin{array}{ccc}{1}& {2}& {3}\\ {0}& {4}& {5}\\ {0}& {0}& {6}\end{array}\right]$ (6)
 > $\mathrm{MatrixOptions}\left(M\right)$
 ${\mathrm{shape}}{=}\left[{{\mathrm{triangular}}}_{{\mathrm{upper}}}\right]{,}{\mathrm{datatype}}{=}{\mathrm{anything}}{,}{\mathrm{storage}}{=}{{\mathrm{triangular}}}_{{\mathrm{upper}}}{,}{\mathrm{order}}{=}{\mathrm{Fortran_order}}$ (7)
 > $\mathrm{MatrixOptions}\left(N\right)$
 ${\mathrm{shape}}{=}\left[\right]{,}{\mathrm{datatype}}{=}{\mathrm{anything}}{,}{\mathrm{storage}}{=}{\mathrm{rectangular}}{,}{\mathrm{order}}{=}{\mathrm{Fortran_order}}$ (8)
 > $P≔\mathrm{Copy}\left(M\right)$
 ${P}{≔}\left[\begin{array}{ccc}{1}& {2}& {3}\\ {0}& {4}& {5}\\ {0}& {0}& {6}\end{array}\right]$ (9)
 > $\mathrm{MatrixOptions}\left(P\right)$
 ${\mathrm{shape}}{=}\left[{{\mathrm{triangular}}}_{{\mathrm{upper}}}\right]{,}{\mathrm{datatype}}{=}{\mathrm{anything}}{,}{\mathrm{storage}}{=}{{\mathrm{triangular}}}_{{\mathrm{upper}}}{,}{\mathrm{order}}{=}{\mathrm{Fortran_order}}$ (10)

 See Also