How to associate a rectangle with a struct?
Ältere Kommentare anzeigen
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 Kommentare
Walter Roberson
am 5 Aug. 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
am 5 Aug. 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
am 5 Aug. 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
am 6 Aug. 2020
Walter Roberson
am 6 Aug. 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
am 6 Aug. 2020
Adam Danz
am 6 Aug. 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
am 6 Aug. 2020
Adam Danz
am 6 Aug. 2020
Oliver Lestrange
am 6 Aug. 2020
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Read, Write, and Modify Image finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
