Reputation: 87
I have a matrix
I have two other matrices (B and C) which is the row index of A from top to bottom.
I want the new A to have only row groups of B and C.
New A:
How to do this?
Upvotes: 1
Views: 50
Reputation: 5822
You'll need to do the following:
You can use the following syntax:
A = A(unique([B;C]),:);
If you know for a fact that B and C don't contain duplications, you can omit the unique function call, and just write:
A = A([B;C],:);
Upvotes: 3