inpolygon help to find number of integer points

3 vues (au cours des 30 derniers jours)
Jenny Briggs
Jenny Briggs le 10 Mar 2016
Modifié(e) : Jenny Briggs le 10 Mar 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.

Réponse acceptée

Torsten
Torsten le 10 Mar 2016
Modifié(e) : Torsten le 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.
  1 commentaire
Jenny Briggs
Jenny Briggs le 10 Mar 2016
It works perfectly now. Thank you so much!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by