How to draw consecutive circles?

2 views (last 30 days)
jorji
jorji on 16 Nov 2021
Edited: DGM on 17 Nov 2021
k = 7. ;
N = 255 ;
x = 0:N ;
y = 0:N ;
[X,Y] = meshgrid(x,y) ;
I = 1/2*(1+sin(2*pi/N*k*X)) ;
imshow(I)

Accepted Answer

DGM
DGM on 17 Nov 2021
Edited: DGM on 17 Nov 2021
Here's an example. You'll need to adjust it for the number of cycles you want. I'm going to replicate the original image.
s = 512; % image size (assumed square)
n = 4.5; % number of cycles from center to corner
xm = n*sqrt(2)*pi; % figure out what the extents are
x = linspace(-xm,xm,s);
r = sqrt(x.^2 + x.'.^2);
M = im2uint8(0.5 - cos(r)/2);
imshow(M)
  1 Comment
jorji
jorji on 17 Nov 2021
Thank you very much for your accurate guidance.

Sign in to comment.

More Answers (0)

Categories

Find more on Printing and Saving in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!