inpolygon help to find number of integer points

3 views (last 30 days)
Hi, i've been trying to write a code to find the number of integer set of coordinates (x,y) within a circle. I'm trying to do this on a circle (0,0), radius 4 below. However the code I've made keeps giving me the wrong answer. It'd be much appreciated if anyone could help me on this or correct my code, thanks.

Accepted Answer

Torsten
Torsten on 10 Mar 2016
Edited: Torsten on 10 Mar 2016
You only consider points (xq,yq) which have the same x- and y- coordinate.
This will give you a wrong answer.
Use meshgrid to generate all combinations of xq- and yq- coordinates.
Best wishes
Torsten.

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!