-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnewexp.m
58 lines (40 loc) · 1.43 KB
/
newexp.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
function [C] = newexp(Znewschlecht,Znewnorm,tablenewnorm,CnormEges,bounds,N,simset)
%Mit Hilfe der günstigen Punkte in 'Znewnorm', werden die neuen Experimente bestimmt.
tablenewnormsort=tablenewnorm;
% Schon Berechnete Punkte werden Entfernt
[~,aid,~] = intersect(tablenewnormsort,CnormEges,'rows');
tablenewnormsort(aid,:)=[];
[~,aid,~] = intersect(Znewschlecht,CnormEges,'rows');
Znewschlecht(aid,:)=[];
%Sortieren
tablenewnormsort=unique(tablenewnormsort,'rows');
%Test auf doppelte
Znewschlecht=unique(Znewschlecht,'rows');
%Wenn noch Punkte bleiben
if isempty(tablenewnormsort)==0
a = randn(numel(tablenewnormsort(:,1)),1);
indicesa = randperm(length(a));
b = randn(numel(Znewschlecht(:,1)),1);
indicesb = randperm(length(b));
%Ggf. anpassung von N
if numel(tablenewnormsort(:,1))<N
N=numel(tablenewnormsort(:,1));
end
%Anzahl der Experimente N muss auf ein Kontingent für Zufallspunkte Z und
%gute Punkte G aufgeteilt werden /////Kontingen 10%
Z=floor(N/10);
G=N-Z;
indicesvona = indicesa(1:G);
indicesvonb = indicesb(1:Z);
dCE = [tablenewnormsort(indicesvona,:);Znewschlecht(indicesvonb,:)];
C=dCE;
for q=1:numel(dCE(:,1))
for i=1:simset
Pm=(C(q,i)*(bounds(1,i)-bounds(2,i))+bounds(1,i)+bounds(2,i))/2;
C(q,i) = Pm;
end
end
else
C=tablenewnormsort;
end
end