ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 17 Apr 2017 07:23:35 -0500How could I copy a matrix to another matrix?http://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.Sun, 16 Apr 2017 21:57:28 -0500http://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>
http://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 07:23:35 -0500http://ask.sagemath.org/question/37310/how-could-i-copy-a-matrix-to-another-matrix/?answer=37319#post-id-37319