How to associate a rectangle with a struct?
Afficher commentaires plus anciens
Hi there Community,
I have the folllowing image and the antenna:
[Horizontal,Vertical,Optional] = msiread(strcat(pathName,fileName));

How can I associate a rectangle to an antenna?
I made the rectangle using:
rectangle('Position', [(x - handles.Rwidth/2) (y - handles.Rwidth/2)...
handles.Rwidth handles.Rheight], 'FaceColor', 'g','LineStyle', 'none');
Is it possible to affect the rectangule with the struct (antenna)?
10 commentaires
Walter Roberson
le 5 Août 2020
Could you explain more what you mean by "associate" ?
Are you asking for some image processing to locate the yellow blobs, calculate the centroids, and then use those centroids as the locations to place antennae ?
Adam Danz
le 5 Août 2020
My guess is that you want to change the position of the rectangle according to some other object on the plot. Changing the position of an existing rectangle can be done by changing its position property.
h = rectangle('Position', [1 2 3 4]);
% change position
h.Position = [2 3 4 5];
Walter Roberson
le 5 Août 2020
I see that you edited your question, but unfortunately I do not know what you mean by "affect the rectangle with the struct (antenna)" ??
Oliver Lestrange
le 6 Août 2020
Walter Roberson
le 6 Août 2020
Are you asking for some image processing to locate the yellow blobs, calculate the centroids, and then use those centroids as the locations to place antennae ?
Oliver Lestrange
le 6 Août 2020
Adam Danz
le 6 Août 2020
If you plotted the yellow squares, then you know their positions. Use the positions to keep track of where the yellow squares are. The problem is still not clear.
Oliver Lestrange
le 6 Août 2020
Adam Danz
le 6 Août 2020
Oliver Lestrange
le 6 Août 2020
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Read, Write, and Modify Image dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
