Split matrix into multiple matrices with same value

Let's say I have a matrix as with the following values:
A = [1 10
2 10
3 10
4 10
20 1
20 2
20 3
20 4];
then I would like to split this into two separate matrices:
B = [1 10
2 10
3 10
4 10];
C = [20 1
20 2
20 3
20 4];
A is just an example, there could be multiple occasions of the same x or y value. So after C is done there could be more values where either the x or the y value is the same. I want all occasions of same values, either x or y, to be split into a new matrix/new dimension of an existing matrix. Can this be done preferably without a loop? It doesn't really matter that much if it's in a loop though.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

질문:

2017년 5월 22일

댓글:

Jan
2017년 5월 22일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by