Hello Friends,
I have a matrix X of size NxD, where the Dth column is labeled. For example:
X = [1, 2, 3, Sunday 4, 5, 6, Monday 7, 8, 9, Sunday 10, 11, 12, Tuesday 13, 14, 15, Monday];
I want to extract the rows corresponding to each labels. So for above matrix, I should get the following matrices:
A = [ 1, 2, 3, Sunday 7, 8, 9, Sunday]; B = [4, 5, 6, Monday 13, 14, 15, Monday]; C = [10, 11, 12, Tuesday];
Here matrix A is of size 2xD, B is of size 2xD and C is of size 1xD.
I will appreciate any advise!
Best Answer