Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Swap elements in a matrix
Replies: 2   Last Post: Nov 21, 2012 12:50 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Jinsoo

Posts: 8
Registered: 9/27/12
Swap elements in a matrix
Posted: Nov 20, 2012 11:39 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi,

I have a question about swapping elements in a matrix. I would like to swap elements in the matrix without making a new matrix. Though I googled about any functions, I failed to find out. Below is the example that shows my intent.

a = [ 3 1 2
2 1 1
5 4 4 ]

I want to change a(1,2) -> a(2,1) and a(2,1)->a(1,2). The edited matrix a will be like this.

a= [ 3 2 2
1 1 1
5 4 4]

Your words will be highly appreciated! Enjoy your Thanksgiving!



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.