plot circle with gradient gray scale color in matlab -
plot circle with gradient gray scale color in matlab -
i want draw circle gradient color in matlab, can't. there 1 can help me?
the sample image can found here
here's 1 approach -
n = 200; %// decides size of image [x,y] = meshgrid(-1:1/n:1, -1:1/n:1) ; nrm = sqrt(x.^2 + y.^2); out = uint8(255*(nrm/min(nrm(:,1)))); %// output image figure, imshow(out) %// show image
output -
if pad output white boundary shown in expect output image, can padarray
-
padsize = 50; %// decides boundary width out = padarray(out,[padsize padsize],255);
matlab
Comments
Post a Comment