ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 17 Apr 2017 14:23:35 +0200How could I copy a matrix to another matrix?https://ask.sagemath.org/question/37310/how-could-i-copy-a-matrix-to-another-matrix/I have a matrix and I wanna copy this matrix to another matrix(let's call them M1 and M2),
but when I use: M2=M1 and modify M1, M2 changes too, which means M1 and M2 are actually one matrix.
So how should I copy the matrix, just the value of entries.Mon, 17 Apr 2017 04:57:28 +0200https://ask.sagemath.org/question/37310/how-could-i-copy-a-matrix-to-another-matrix/Answer by FrédéricC for <p>I have a matrix and I wanna copy this matrix to another matrix(let's call them M1 and M2),</p>
<p>but when I use: M2=M1 and modify M1, M2 changes too, which means M1 and M2 are actually one matrix.</p>
<p>So how should I copy the matrix, just the value of entries.</p>
https://ask.sagemath.org/question/37310/how-could-i-copy-a-matrix-to-another-matrix/?answer=37319#post-id-37319Like that
M2=copy(M1)Mon, 17 Apr 2017 14:23:35 +0200https://ask.sagemath.org/question/37310/how-could-i-copy-a-matrix-to-another-matrix/?answer=37319#post-id-37319