How to associate a rectangle with a struct?
显示 更早的评论
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 个评论
Walter Roberson
2020-8-5
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
2020-8-5
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
2020-8-5
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
2020-8-6
Walter Roberson
2020-8-6
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
2020-8-6
Adam Danz
2020-8-6
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
2020-8-6
Adam Danz
2020-8-6
Oliver Lestrange
2020-8-6
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Read, Write, and Modify Image 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
