Tolerance with ismembertol different for x and y when using "byrows"

1 回表示 (過去 30 日間)
Tim Trinklein
Tim Trinklein 2020 年 11 月 10 日
I have two 2D arrays, A an B.
A has variable length, from ~8 to 14 and is a set of 2D coordinate pairs (x,y). I would link to find if and how many of the coordinate pairs in A"match" to a set of coordinate pairs in the 2D array B (fixed at 10 pairs), within some specified tolerance (e.g., +/- 2 on x and +/- 4 on y).
E.g., I want to match the entry (101, 24) in A to the entry (99.668, 23.970) in B, and know if there are multiple entries that match.
I have setup code using ismember tol (below), however, I couldn't seem to find away to set the tolerance differently for x and y. Moreover, I'm not clear on the syntax to setup unscaled tolerance. I.e., I want to specify absolute tolerance (not scaled to anything), but I don't know how to fit it in with the rest of the inputs. Thanks!
[Ax,Bx] =ismembertol(A,B,0.1,'ByRows',1)
nFP = length(Ax(Ax==0));
nTP_original = length(Ax(Ax==1));
nredundant_hits = length(Bx) - length(unique(Bx))
nTP = nTP_original - nredundant_hits;

回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by