Cody

Problem 198. Are you in or are you out?

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

Solution Stats

61.31% Correct | 38.69% Incorrect
Last solution submitted on Sep 25, 2016

Problem Comments

Tags

Discover MakerZone

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

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!

Join the 15-year community celebration.

Play games and win prizes!

Learn more