What is the behavior of 'polybool' with NaN-delimited Input?
1 view (last 30 days)
Show older comments
MathWorks Support Team
on 5 Jan 2015
Answered: MathWorks Support Team
on 6 Jan 2015
When I call polybool as follows, I get empty intersections, as expected:
[x,y]=polybool('&',...
[0,0,1,0],...
[0,1,0,0],...
[0,1,1,0],...
[1,1,0,1])
[x,y]=polybool('&',...
[0,1,1,0],...
[1,1,0,1],...
[0,0,1,0],...
[0,1,0,0])
When I combined the x & y inputs from both calls with a NaN in between, I expected the call to polybool to process the above computations in parallel. Instead I got a nonempty intersection.
Accepted Answer
MathWorks Support Team
on 5 Jan 2015
Although the documentation is not as clear, this is expected behavior. When a polygon is represented as a Nan-delimited vector, the NaNs separate the contours of a single polygon. An equivalent way of writing this would be to use a cell array containing vectors of the contour.
0 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!