Hi all,
There are some functions which accepts 2 inputs, such as inpolygon. For example:
K>> xvxv = 1 2 2 1K>> yvyv = 1 1 2 2K>> x = 1.5x = 1.5000K>> y = 1.5y = 1.5000K>> inpolygon(x, y, xv, yv)ans =logical 1
Which is completely fine. However, if I have an array which contains x-y coordinates, such as:
K>> xy = [1.5 1.5]xy = 1.5000 1.5000
How can I use xy as an input instead of using x and y separately? I do not want to extract x and y manually like:
K>> x = xy(1), y = xy(2)
I want something like:
K>> inpolygon(xy, x, y)Not enough input arguments.Error in inpolygon (line 64)if ~isvector(xv) || ~isvector(yv)
but there is error. Any ideas?
Best Answer