MATLAB Answers

how can i add the two different polyshape to another varriable and then can check the overlap between them ?

3 ビュー (過去 30 日間)
jahanzaib ahmad
jahanzaib ahmad 2018 年 12 月 26 日
回答済み: Steven Lord 2018 年 12 月 26 日
is there any way out how can i get new varriable with two polyshapes ? one is circle other is polygon

  0 件のコメント

サインインしてコメントする。

回答 (2 件)

Steven Lord
Steven Lord 2018 年 12 月 26 日
The line where that error occurred is
a(i) = polyin2;
Why are you trying to store your polyshape as a single element of the double array of coordinate data you used to create polyin1?
If you're using release R2018a or later, use the overlaps function to determine if they overlap, or call intersect to determine the intersection then calculate the area of that intersection.
You may be interested in this blog post which uses overlap calculation to determine if two states share a border.

  0 件のコメント

サインインしてコメントする。


Image Analyst
Image Analyst 2018 年 12 月 26 日
Not sure how to do it with polyshapes, but if you want to use poly2mask() to create a digital image, then you could use & on the two binary images
binaryImage1 = polymask(x1, y1, rows, columns);
binaryImage2 = polymask(x2, y2, rows, columns);
overlapImage = binaryImage1 & binaryImage2;

  0 件のコメント

サインインしてコメントする。

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by