inpolygon help to find number of integer points

3 ビュー (過去 30 日間)
Jenny Briggs
Jenny Briggs 2016 年 3 月 10 日
編集済み: Jenny Briggs 2016 年 3 月 10 日
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.

採用された回答

Torsten
Torsten 2016 年 3 月 10 日
編集済み: Torsten 2016 年 3 月 10 日
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 件のコメント
Jenny Briggs
Jenny Briggs 2016 年 3 月 10 日
It works perfectly now. Thank you so much!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by