フィルターのクリア

Rows contained in other rows

2 ビュー (過去 30 日間)
Alberto Rocha
Alberto Rocha 2017 年 2 月 16 日
コメント済み: Alberto Rocha 2017 年 2 月 22 日
I have a matrix such as A=[1 2 3;1 3 5] and I want to determine which row(s) is(are) totally contained in one (or more) single row(s) of another matrix such as B=[1 4 3 2 8;1 4 5 9;1 2 5 8 9]. In this example, row 1 of A is contained is the first row of B, but second row of A is NOT contained in a single row of B (elements 1 and 3 are in first row of B, and element 5 is in second). I know I could use ISMEMBER function for each row of A, but my matrices are too large, and a loop would take too long. Does anyone have a solution for that without a FOR-END or WHILE-END loop?

採用された回答

Image Analyst
Image Analyst 2017 年 2 月 16 日
How large? What are your actual, typical size dimensions for A and B? I just did a for loop with a million iterations and the for loop itself (not with ismember in it) took 0.002 seconds.
One way to do it with 2-D arrays is to use normalized cross correlation with normxcorr2(). See attached demo.
  5 件のコメント
Image Analyst
Image Analyst 2017 年 2 月 18 日
You could use the moving SAD method - very accurate, but it might be slow.
Alberto Rocha
Alberto Rocha 2017 年 2 月 22 日
Thanks a lot. I'll try to learn how to use this function.

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

その他の回答 (0 件)

カテゴリ

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