MATLAB: How to separate each layer of concentric circular strip of different color

digital image processingimage analysisimage processingimage segmentationmatlab coder

i have a code for concentric circular strip and i want to separate each layer so how to do? code is given below.
X = ones(256,1)*[-128:127]; Y = [-128:127]'*ones(1,256);
Z = X.^2 + Y.^2;
% mesh(Z);
image = zeros(256,256);
image(find(Z<= 60^2)) = 0.3;
image(find(Z<= 40^2)) = 0.5;
image(find(Z<= 20^2)) = 0.8;
imshow(image);

Best Answer

X = ones(256,1)*[-128:127];
Y = [-128:127]'*ones(1,256);
Z = X.^2 + Y.^2;
% mesh(Z);
image = zeros(256,256);
image(find(Z<= 60^2)) = 0.3;
image(find(Z<= 40^2)) = 0.5;
image(find(Z<= 20^2)) = 0.8;
subplot(221)
imshow(image);
%%pick between 0.3 and 0.5
Zi = image ;
Zi(image~=0.3) = 255;
subplot(222)
imshow(Zi)
Zi = image ;
Zi(image~=0.5) = 255 ;
subplot(223)
imshow(Zi)
Zi = image ;
Zi(image~=0.8) = 255 ;
subplot(224)
imshow(Zi)