%step1: Latin Hypercube sampling (LHS)

% FW_3
clc;clear;close all
%设置均值和⽅差，采样点数
Mu=[12;20;2.5]; %均值
Sigma=[4,15,1]; %⽅差
N = 30; % 样本点数⽬
D = size(Mu,1); % 维数
Covariance_Matrix = zeros(D,D);
for i = 1:D
    Covariance_Matrix(i,i) = Sigma(i)^2;
end
UB = Mu + 3*Sigma;
LB = Mu - 3*Sigma; % 取值范围
X = lhsnorm(Mu, Covariance_Matrix, N);
%  X = lhsnorm(Mu, Sigma, N);
figure(1)
plot(X(:,1),X(:,2),'*');grid on
title('正态分布的LHS采样')

% FW_2
% clc;clear;close all
% %设置均值和⽅差，采样点数
% Mu=[12;20]; %均值
% Sigma=[4,15]; %⽅差
% N = 20; % 样本点数⽬
% D = size(Mu,1); % 维数
% Covariance_Matrix = zeros(D,D);
% for i = 1:D
%     Covariance_Matrix(i,i) = Sigma(i)^2;
% end
% UB = Mu + 3*Sigma;
% LB = Mu - 3*Sigma; % 取值范围
% X = lhsnorm(Mu, Covariance_Matrix, N);
% %  X = lhsnorm(Mu, Sigma, N);
% figure(1)
% plot(X(:,1),X(:,2),'*');grid on
% title('正态分布的LHS采样')


