Help in finding values between limits
1 回表示 (過去 30 日間)
古いコメントを表示

The brackets on the left are the coordinates of various points along the left black line. the red lines connecting the two black lines indicate the distance (in pixels).
I have the matrix A:
A = 3 0
2 2
2 1
3 3
which corresponds to the coordinate points I am looking for satisfying the equation of a line ( (x - a)^2 + (y - b)^2 = r^2 ).
Now, x & y correspond to the values in matrix A, while a & b correspond to the coordinate points (in brackets on the image) r is the pixel distance
An example using the point (0,2):
a = 0, b = 2, r = 2
if I implement this code:
B = A((A(:,1)-a).^2+(A(:,2)-b).^2==r^2,:);
I will get a matrix displaying the following:
B = 2 2
Now what I want to do is make sure that only 1 value is displayed in B using the condition that
a - r < x < a + r
&
b - r < y < b + r
where x and y are the values in B, I want this to be done to make sure that I am displaying only one the closest point which satisfies.
0 件のコメント
回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Image Segmentation and Analysis についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!