inpolygon help to find number of integer points

3 visualizaciones (últimos 30 días)
Jenny Briggs
Jenny Briggs el 10 de Mzo. de 2016
Editada: Jenny Briggs el 10 de Mzo. de 2016
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.

Respuesta aceptada

Torsten
Torsten el 10 de Mzo. de 2016
Editada: Torsten el 10 de Mzo. de 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.

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by