www.pudn.com > array.zip > rec_to_circ.m, change:2003-06-22,size:289b


function amn = rec_to_circ(N) 
midpoint = (N-1)/2 + 1; 
amn = zeros(N); 
array1(midpoint,midpoint) = N; 
x0 = midpoint; 
y0 = x0; 
for i = 1:N 
    for j = 1:N 
        distance(i,j) = sqrt((x0-i)^2 + (y0-j)^2); 
    end 
end 
idx = find(distance < (N-1)/2 + .025); 
amn (idx) = 1; 
return