??这是我要读取的数据,如何遍历矩阵的每一行,找出存在相同数(若存在,实际是四个数相同)的两行,并把它这两行从新写入一个新的矩阵,由于矩阵中存在众多两行中有相同的数,所以我不知道如何写入新矩阵。后面不知道如何写了,请大神指教
connect = 下面的那些数据;
ne= size(connect,1);
for i=1:ne
for j=1:ne
[c,ia,ib]=intersect(connect(i,:),connect(j,:))
end
end
1, 21, 22, 26, 25, 1, 2, 6, 5
2, 22, 23, 27, 26, 2, 3, 7, 6
3, 23, 24, 28, 27, 3, 4, 8, 7
4, 25, 26, 30, 29, 5, 6, 10, 9
5, 26, 27, 31, 30, 6, 7, 11, 10
6, 27, 28, 32, 31, 7, 8, 12, 11
7, 29, 30, 34, 33, 9, 10, 14, 13
8, 30, 31, 35, 34, 10, 11, 15, 14
9, 31, 32, 36, 35, 11, 12, 16, 15
10, 33, 34, 38, 37, 13, 14, 18, 17
11, 34, 35, 39, 38, 14, 15, 19, 18
12, 35, 36, 40, 39, 15, 16, 20, 19
13, 41, 42, 46, 45, 21, 22, 26, 25
14, 42, 43, 47, 46, 22, 23, 27, 26
15, 43, 44, 48, 47, 23, 24, 28, 27
16, 45, 46, 50, 49, 25, 26, 30, 29
17, 46, 47, 51, 50, 26, 27, 31, 30
18, 47, 48, 52, 51, 27, 28, 32, 31
19, 49, 50, 54, 53, 29, 30, 34, 33
20, 50, 51, 55, 54, 30, 31, 35, 34
21, 51, 52, 56, 55, 31, 32, 36, 35
22, 53, 54, 58, 57, 33, 34, 38, 37
23, 54, 55, 59, 58, 34, 35, 39, 38
24, 55, 56, 60, 59, 35, 36, 40, 39
25, 61, 62, 66, 65, 41, 42, 46, 45