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!
