% GRADIENT N = 400;
[X,Y]=meshgrid( linspace(1,1.01,N), linspace(1,1.01,N) );
Z = 0.99*sqrt( max(1(X.^2+Y.^2),0) );
I = mat2gray(Z);
figure(1)
imshow(I)
imwrite(I, 'gradient.png')

% QUANTIZATION
c = 14
figure(2)
A = floor( c*Z );
I = mat2gray(A);
imshow(I)
imwrite(I, 'output.png') 
c = 6 
c = 14 
c = 2 
c = 6 
c = 10 
c = 14 
dim = 4, c =
4 
dim = 16, c = 4 
c = 2 
c = 4 
c = 6 
c = 8 