% 绘制底图 黑心白边
M = 201;N = 201;
pic = ones(M,N);
% 从1-0变化,每次间隔0.01 共设置100道
index = (0:.01:1)';
for i=1:M
for j=1:N
d = sqrt((i-100)^2+(j-100)^2);
r = round(d);
if r<=99
pic(i,j) = index(r+1);
end
end
end
imshow(pic)
axis equal
axis off
如果要白心黑边,就改一下初始矩阵和index就行