How to draw consecutive circles?
2 views (last 30 days)
Show older comments
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)
0 Comments
Accepted Answer
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)
More Answers (0)
See Also
Categories
Find more on Printing and Saving in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!