### The Maxima on-line user's manual

Algebra Calculator

#### Copymatrix

Function: copymatrix (<M>) Returns a copy of the matrix <M>. This is the only way to make a copy aside from copying <M> element by element.

Note that an assignment of one matrix to another, as in `m2: m1`, does not copy `m1`. An assignment `m2 [i,j]: x` or `setelmx (x, i, j, m2` also modifies `m1 [i,j]`. Creating a copy with `copymatrix` and then using assignment creates a separate, modified copy.

```(%o1)                                true
(%i2) ```

### Related Examples

S:3;

A:2;

xRef:20;

Calculate

##### copymatrix-ident-identfor-matrix-print

M : matrix ([1, 2...

print (ident (2), ...

M : matrix ([1, 2...

Calculate

? copymatrix;

Calculate

S:3;

A:2;

xRef:20;

Calculate

S:3;

A:2;

xRef:20;

Calculate

S:3;

A:2;

xRef:20;

Calculate

##### copymatrix-ident-identfor-matrix-print

M : matrix ([1, 2...

print (ident (2), ...

M : matrix ([1, 2...

Calculate

? copymatrix;

Calculate

S:3;

A:2;

xRef:20;

Calculate

S:3;

A:2;

xRef:20;

Calculate