I tried to use the rectangle function.
rectangle ('position', [-0, -0, 8, 8], 'curvature', [1, 1])
but then i am not sure how to get this data in a matrix. I tried
saveas with gcf but then i end up with a border.
Any suggestions are appreciated
Thanks
Jomile
I found this nice solution somewhere on the internet a few years
ago... can't remember where it came from. cx and cy are the center
coordinates of the circle, r is its radius, and ix and iy are the size
of the image mask, in pixels.
cx=64;cy=32;ix=128;iy=128;r=30;
[x,y]=meshgrid(-(cx-1):(ix-cx),-(cy-1):(iy-cy));
c_mask=((x.^2+y.^2)<=r^2);
imagesc(c_mask)