variant
A = randi(170,200);
sz = size(A);
center = [50 50];
N = 3;
Outnum = A(max(abs(repmat(1:sz(2),size(A,1),1) - center(1)) ,...
abs(repmat((1:sz(1))',1,size(A,2)) - center(2))) == fix(N/2));
more with bwdist from Image Processing Toolbox
A = randi(170,200);
sz = size(A);
center = [50 50];
N = 3;
AA = zeros(sz);
AA(center(1),center(2)) = 1;
Outnum = A(bwdist(AA,'chessboard')==fix(N/2));
Hi Oleg! Variant for N > 3
A = randi(170,17,13);
sz = size(A);
center = [8 7];
N = 5;
ons = ones(N);
ons(2:end-1,2:end-1) = 0;
ij = bsxfun(@plus, center.'-fix(N/2),0:N-1);
Outnum = A(ij(1,:),ij(2,:)).*ons;
Outnum = Outnum(Outnum>0);
Best Answer