File Exchange

image thumbnail


version 1.1 (21.5 KB) by

Finds points inside multiple polygons, holes possible.



Test whether point(s) are in polygon(s) in Matlab

Comments and Ratings (6)

Kelly Kearney


What version of Matlab are you running? The example runs fine on my computer, R2007b (Mapping Toolbox 2.4). But the line numbers you list don't agree with either of my copies of the code (the inpolygons line you note as 59 is line 69 in the code offered here, and the line you note in polysplit doesn't appear at all in my version of polysplit.m).

Ben G

Got an error just running the example.

??? Error using ==> vertcat
All rows in the bracketed expression must have the same
number of columns.

Error in ==> polysplit at 35
if ~isnan( lat(length(lat)) ); lat = [lat; NaN]; end

Error in ==> inpolygons at 59
[xsplit, ysplit] = polysplit(xv, yv);

Matt K.

Works perfectly and very quickly!
The Mapping Toolbox saves me again!

Gennady Khokhorin

Thanks, nice work!

Eleonora Vidolova

peng wenmin



Linked to GitHub repository

MATLAB Release
MATLAB 7.0.1 (R14SP1)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video