-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_fis_noise_set.m
51 lines (50 loc) · 1.51 KB
/
create_fis_noise_set.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
val=zeros(21,1);
k=0;
for dist=0:0.5:10
k=k+1;
current_var=[0.1;1.3]*0.4/(1+dist/5);
%current_var=[0.1;1.3]*0.4;
max_res=0;
rests=zeros(1,100000);
for i=1:100000
res=normrnd([0;0],current_var);
rests(i)=res(2);
end
r=sort(rests);
val(k)=r(99000);
end
val_full=[flip(val);val];
x=linspace(0,20,length(val_full));
opt = genfisOptions('GridPartition');
opt.NumMembershipFunctions = 3;
opt.InputMembershipFunctionType = "trimf";
fis = genfis(x',val_full,opt);
[in,out,rule] = getTunableSettings(fis);
fisout = tunefis(fis,[in;out],x',val_full,tunefisOptions("Method","anfis"));
% input=zeros(21*15,2);
% output= zeros(21*15,1);
% k=0;
% for dist=0:0.5:10
% for vel=0:0.1:1.5
% k=k+1;
% current_var=[0.1;1.3]*0.4/(1+dist/5)*vel/1.5;
% %current_var=[0.1;1.3]*0.4;
% max_res=0;
% rests=zeros(1,20000);
% for i=1:20000
% res=normrnd([0;0],current_var);
% rests(i)=res(2);
% end
% r=sort(rests);
% input(k,:)=[dist+10,vel];
% output(k)=r(19800);
% end
% end
% output_full=[output;output];
% input_full=[input;flip(input(:,1)-10),input(:,2)];
% opt = genfisOptions('GridPartition');
% opt.NumMembershipFunctions = [3,3];
% opt.InputMembershipFunctionType = "trimf";
% fis = genfis(input_full,output_full,opt);
% [in,out,rule] = getTunableSettings(fis);
% fisout = tunefis(fis,[in;out],input_full,output_full,tunefisOptions("Method","anfis"));