我哪里做错了?问题出在:R = sqrt(bsxfun(@minus,XX,(XX)').^2+bsxfun(@minus,YY,(YY)').^2);
EO = 8.8541e-12; %eps0
A2 = 1.0e-2; %2a
N = 100; %num of subareas in a plate
M = sqrt(N); %num of subareas in one axis
DX = A2/M; % 2b
DY = DX; %2b
DL = DX; %2b
% SECOND, CALCULATE THE ELEMENS OF THE COEFFICIENT MATRIX A
% Write all the subareas centers coordinates to X and Y
% SECOND, CALCULATE THE ELEMENS OF THE COEFFICIENT MATRIX A
% Write all the subareas centers coordinates to X and Y
x = linspace(DL*0.5,DL*(M-0.5),M);
y = x;
[XX,YY]=meshgrid(x,y);
%%L = NaN(N,N);
**R = sqrt(bsxfun(@minus,XX,(XX)').^2+bsxfun(@minus,YY,(YY)').^2);**
idx_diagL = find(eye(N)~=0);
idx_not_diagL = find(eye(N)==0);
L(idx_not_diagL) = DL^2./(4.*pi*EO*R(mod(idx_not_diagL,10),floor(idx_not_diagL/N)));
L(idx_diagL) = DL*0.8814/(pi*EO); %ln(1+sqrt(2)= 0.8814