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: finding a column that has X element in each row
Replies: 5   Last Post: Nov 19, 2012 2:07 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
finding a column that has X element in each row
Posted: Nov 18, 2012 9:29 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi,

I have a question regarding how to find a column that has X element in each row.
For example,
a=
[ 1 2 3 4 5
2 1 4 3 5
3 4 5 1 2]

I would like to find a column that has element 2 in each row.
My goal is to turn out data (from the above example) [2 1 5] which means [column 2, column 1, column 5]

Is there any way to do this?



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.