Demo entry 6770504

LHS

   

Submitted by Sam on Nov 13, 2018 at 16:55
Language: Matlab. Code size: 414 Bytes.

N = 100; n = 3; ub = 2; lb = -2; iter = 2000;
bin = (ub-lb)/N;
order(1,:) = randperm(N);
order(2,:) = randperm(N);
order(3,:) = randperm(N);

temp = bin*rand(3,N);

x = LHS(N,ub,lb,order);
x = x + temp;
E = Uni_cal(x);

function x = LHS(N,ub,lb,order)

bin = (ub-lb)/N;

for i = 1:N
    x(1,i) = lb+bin*(order(1,i)-1);
    x(2,i) = lb+bin*(order(2,i)-1);
    x(3,i) = lb+bin*(order(3,i)-1);
end

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).