Ask Your Question
1

How could I copy a matrix to another matrix?

asked 2017-04-17 04:57:55 +0100

Zhengguan Li gravatar image

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.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
3

answered 2017-04-17 14:23:35 +0100

FrédéricC gravatar image

Like that

M2=copy(M1)
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-04-17 04:57:28 +0100

Seen: 2,561 times

Last updated: Apr 17 '17