I think inpolygon is overkill in this case; you really only need to know the azimuth between your center point and the target points in order to assign a quadrant. Do you have the Mapping Toolbox? If so, the azimuth function will do all the work for you:
pt = [...
30.433 -91.759
29.761 -90.3
29.181 -92.199
33.065 -92.344
32.923 -90.332
32.906 -94.435
30.481 -93.619
28.779 -93.766
28.496 -92.399
29.584 -91.312
31.557 -93.136
34.089 -89.848
33.121 -89.231
32.418 -90.307
29.384 -90.569
29.517 -92.767
33.018 -93.567
31.584 -92.277
30.551 -90.219
32.844 -91.866
30.675 -90.202
29.538 -89.232
29.514 -89.553
32.335 -92.06
32.331 -90.235
29.598 -91.418
33.126 -90.745
33.766 -89.968
32.497 -90.36
31.199 -88.882];
lat = 31.56;
lon = -91.39;
az = azimuth(pt(:,1), pt(:,2), lat, lon);
qedge = [0 22.5:45:360 360];
[n, iq] = histc(az, qedge);
iq(iq == 9 | iq == 10) = 1;
[ltout, lnout] = reckon(lat, lon, 5, qedge(2:end-1));
plot([ones(1,8)*lon; lnout], [ones(1,8)*lat; ltout], 'k');
hold on;
scatter(pt(:,2), pt(:,1), 20, iq, 'filled');
Best Answer