MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Today**New to MATLAB?**

Given vertices specified by the vectors xv and yv, and a single point specified by the numbers X and Y, return "true" if the point lies inside (or on the boundary) of the polygon defined by the vertices.

Example:

% The specified point is the center of the unit square: xv = [0 1 1 0]; yv = [0 0 1 1]; X = 0.5; Y = 0.5;

inside(xv,yv,X,Y) -----> true

77 correct solutions
46 incorrect solutions

Last solution submitted on Jun 06, 2015

1 player likes this problem

2 Comments