필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How to plot an NxN array of circles?

조회 수: 1 (최근 30일)
Viron Gil Estrada
Viron Gil Estrada 2018년 2월 11일
마감: Walter Roberson 2018년 2월 11일

I want to plot an NxN array of circles. Just to visualize, I attached an image of what I want to achieve. I'm new in MatlLab so I tried to plot a single circle first, and here is the sample code below:

n = 2^10;                   % size of mask
M = zeros(n);
I = 1:n;
x = I - n/2;                % mask x - coordinates
y = n/2 - I;                % mask y - coordinates
[X,Y] = meshgrid(x,y);      % create 2-D mask grid
R = 200;                     % aperture radius
A = (X.^2 + Y.^2 <= R^2);   % Circular aperture of radius R
M(A) = 1;                   % set mask elements inside aperture to 1
imagesc(M)                  % plot mask
axis image

I really don't have any idea on how to plot a 2D-array of circles. The distance between two circles is two radii. I need this for my research. Hoping anyone can help.

답변 (0개)

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by