function [ S ] = sample_uniform( LB, UB, N, D )
%UNTITLED2 此处显示有关此函数的摘要
%   此处显示详细说明
% Mu = [59;57;55];
% Sigma = [3,3,3];
% LB=[45 45];
% UB=[86.6 86.6];
 N = 1000; % 样本点数目
% UB = Mu + 3*Sigma;
% LB = Mu - 3*Sigma; % 取值范围
P = zeros(N,N); 
D = 3; % 维数
Num = 1;  % 重复次数
Lbb=repmat(LB(1),N,D);
 
Lmax = 0;
for q = 1:Num
    
  for i = 1:D
    S(:, i) = ((randperm(N) -1 + rand(1, N)))' / N;
  end
  
  for i = 1:N
    for j = 1:N
      P(i,j) = sqrt((S(i,1)-S(j,1))^2 + (S(i,2)-S(j,2))^2);
    end
  end
  
  P(P == 0) = 1;
  m = min(P);
  mm = min(m);
  if mm>Lmax % mm越大越好，mm为二维矩阵P中的最小元素
    Lmax = mm;
    Sout = S;
  end
end
 
S = Sout+Lbb; % 样本点的取值
% figure(6)
% plot(Sout(:,1),Sout(:,2),'*')



end

