-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathen.m
42 lines (40 loc) · 1014 Bytes
/
en.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
function e = en(x)
% if x < d
% e = 2.2060/d*x;
% elseif d <= x && x < 0.24
% e = -(2.2060-4.0668)/0.11*(x-d)+2.2060;
% elseif 0.24 <= x && x < 0.50
% e = -(4.0668-5.883)/0.26*(x-0.24)+4.0668;
% elseif 0.50 <= x
% e = -(5.883-13.0635)/0.5*(x-0.50)+5.883;
% end
% if x < d
% e = 2.2060/d*x;
% elseif d <= x && x < c
% e = -(2.2060-3.1568)/0.06*(x-d)+2.2060;
% elseif c <= x && x < 0.24
% e = -(3.1568-4.0668)/0.05*(x-c)+3.1568;
% elseif 0.24 <= x && x < 0.50
% e = -(4.0668-5.883)/0.26*(x-0.24)+4.0668;
% elseif 0.50 <= x
% e = -(5.883-13.0635)/0.5*(x-0.50)+5.883;
% end
a = 0.44+0.04;
b = 0.20+0.04;
c = 0.15+0.04;
d = 0.11+0.04;
e = 0;
if x < d
e = 2.7060/d*x;
elseif d <= x && x < c
e = -(2.7060-3.5568)/(c-d)*(x-d)+2.7060;
elseif c <= x && x < b
e = -(3.5568-4.5668)/(b-c)*(x-c)+3.5568;
elseif b <= x && x < a
e = -(4.5668-5.883)/(a-b)*(x-b)+4.5668;
elseif a <= x
e = -(5.883-12.5635)/(1-a)*(x-a)+5.883;
end
% e = 12.5635*x;
e = e/100;
end