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.

1 件のコメント

Jan
Jan 2017 年 5 月 22 日
What happens for:
A = [1, 2; ...
1, 3; ...
2, 3, ...
2, 4]
?

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCreating 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