traversing a long matrix

1 回表示 (過去 30 日間)
pammy
pammy 2013 年 5 月 9 日
i've a matrix named A of size 2 x 16421
i want to compare one row with the other rows and whenever there is a match it spaecifies their index i mean which row number matches
A=[ 12 45
32 56
19 89
12 45
1 0
0 0
44 21
32 56
32 56
12 45
33 78
90 32
19 89 and so on....]
it starts with 12 45 and compare it with all other rows and shows there index value next it starts with 32 56 and compare it with other rows and when there is a match shows their index.
when i traverse it one by one it takes very long time can anybody tell me how can i do so?

採用された回答

John Doe
John Doe 2013 年 5 月 9 日
編集済み: John Doe 2013 年 5 月 9 日
I think this should work
ind = find(A(:,1) == A(:,2));
- Rob

その他の回答 (1 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by