Gistlib Logo

gistlib

make a square image with circle in the middle, shortest answer in matlab

main.m
img = zeros(100, 100);
[x, y] = meshgrid(1:100, 1:100);
circle = sqrt((x-50).^2 + (y-50).^2) <= 25;
img(circle) = 255;
imshow(img, []);
136 chars
6 lines

similar matlab code snippets

make a square image with rectangle in the middle in matlab
extend line made of two points across whole image in matlab
select all pixels from x,y in an image by 20 pixels radially in matlab in matlab
how to calculate the area of a square in matlab
how to calculate the area of a parallelogram in matlab
how to calculate the area of a trapezoid in matlab
how to calculate the area of a polygon in matlab
how to calculate the area of a triangle in matlab
calculate the area of a sphere in matlab
how to calculate the area of a segment in matlab

related categories

matlab
image-processing
geometry

gistlibby LogSnag