I am dealing with matrices of this format:
M = 1 1 3 1 1 1 1 2 2 1 2 1 1 2 2 2 1 5 2 1 1 2 2 3 2 2 4 2 2 2 ...
What I want to do is extract the submatrices where the values ββin the first and second columns can be grouped so that:
M1 = 1 1 3 1 1 1 M2 = 1 2 2 1 2 1 1 2 2 M3 = 2 1 5 2 1 1 ...
I'm trying to think about how to index the matrix for this, and I have an available matrix:
I = 1 1 1 2 2 1 2 2 ...
which I could use for indexing. I was wondering if I can use it, but I'm not 100% sure. I do not want to use a for loop, since matrices can be quite large and the complexity order can become very large.
Thanks for reading!
source share