[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Easy way to split a matrix according to column value
From: |
alewar |
Subject: |
Easy way to split a matrix according to column value |
Date: |
Wed, 2 Feb 2011 06:49:44 -0800 (PST) |
Hello,
perhaps someone can help me with this.
Suppose I have the following matrix:
m =
0 0 1
0 1 0
0 1 1
1 0 0
1 1 0
1 1 1
and I want to split it depending on the values of a column.
For example, give me the submatrix for which the second column is 1
0 1 0
0 1 1
1 1 0
1 1 1
or for which the 3rd column is 0
0 1 0
1 0 0
1 1 0
etc.
Is there an easy way to do this without a for-loop?
Many thanks!
--
View this message in context:
http://octave.1599824.n4.nabble.com/Easy-way-to-split-a-matrix-according-to-column-value-tp3254400p3254400.html
Sent from the Octave - General mailing list archive at Nabble.com.
- Easy way to split a matrix according to column value,
alewar <=