First time here? Check out the FAQ!

Ask Your Question
1

How could I copy a matrix to another matrix?

asked 8 years ago

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.

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
3

answered 8 years ago

FrédéricC gravatar image

Like that

M2=copy(M1)
Preview: (hide)
link

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: 8 years ago

Seen: 2,810 times

Last updated: Apr 17 '17