I want to use 'if statement' as such that if the points are inside the cell (say C{7}), it will display 'inside cell' and if it is outside the cell (say C{7}) it displays 'outside cell'.
I wrote a piece of code to sort of illustrate what I want to do but it does not seem to be working.
clc,clear allx_bis = [2 5 8 8 5 2 5];y_bis = [1 1 1 9 9 9 5];[V,C] = voronoin([x_bis' y_bis'])voronoi(x_bis,y_bis)axis([0 10 0 10])hold onP = [5 5];plot(P(:,1),P(:,2),'*k')if P == C(7) %in other words, if the point is inside the cell C{7}
display('inside cell')else display('outside cell')end
Best Answer