Help in finding values between limits
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Voir également
Catégories
En savoir plus sur Image Segmentation and Analysis dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!