Why is the function isinterior filling up memory?
显示 更早的评论
Hi all,
I have matrices of x and y coordinates of size 751, 337 and a polygon with 3700 vertices. I am trying to extract the x,y coordinates of the matrix that are comprised within my polygon. I have reshaped my x and y matrices to two vectors xV and yV of size 751*337,1 and am trying to use the function isinterior:
isinterior(polyshape, xV, yV)
The code fills up both my RAM memory and HD and never completes. I am running that code on my MBP that has 16Gb of RAM and 50Gb of free space on my disk, and the activity monitor during the computation shows 44Gb of RAM used and fills up my HD until I have about 1Gb free.
Does anyone have any idea why that occurs and, alternatively, any idea of an alternative? Before 2017b I have commonly used inpolygon and inpoly (available on the file exchange) and although it has sometime be time consuming, I never had this problem of memory. I can't rely on them because my polygon has holes in it. And yes, I know my data is quite big!
Thanks a lot!
1 个评论
Bruno Luong
2018-10-18
编辑:Bruno Luong
2018-10-18
If you have a hole, for workaround, just do
in = inpolygon(..., xextern, yextern) & ...
~inpolygon(..., xintern, yintern)
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Polygonal Shapes 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
