-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest_sub.py
More file actions
68 lines (67 loc) · 2.14 KB
/
test_sub.py
File metadata and controls
68 lines (67 loc) · 2.14 KB
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
59
60
61
62
63
64
65
66
67
68
import matlab.engine
import time
import random
from datetime import date, datetime
date_str_fmt = "%d/%m/%Y %H:%M:%S"
MATLAB_ENG = matlab.engine.start_matlab('-nodesktop -nodisplay')
TIMES = 50
SETS = 200
TOTAL_SEC = 0
time.sleep(2)
random.seed(20)
for _ in range(TIMES):
futures = []
beg_time = datetime.now()
# for i in range(SETS):
# futures.append(
# MATLAB_ENG.SINR_Channel_Model_5G_mex(
# float(random.randrange(500, 1000, 1)),
# float(25),
# float(1.5),
# float(2),
# float(23),
# float(180000),
# matlab.double([10 for _ in range(3)]),
# matlab.double([1.5 for _ in range(3)]),
# matlab.double([random.randrange(100, 600, 1) for _ in range(3)]),
# matlab.double([10 for _ in range(3)]),
# float(0.1 * 1000), # us->ns
# float(4.69 * 1000), # us->ns
# True,
# float(0.001),
# float(23 - 3.01029995664),
# False,
# True,
# nargout=9,
# background=True
# )
# )
# for f in futures:
# f.result()
for i in range(SETS):
MATLAB_ENG.SINR_Channel_Model_5G_mex(
float(random.randrange(500, 1000, 1)),
float(25),
float(1.5),
float(2),
float(23),
float(180000),
matlab.double([10 for _ in range(3)]),
matlab.double([1.5 for _ in range(3)]),
matlab.double([random.randrange(100, 600, 1) for _ in range(3)]),
matlab.double([10 for _ in range(3)]),
float(0.1 * 1000), # us->ns
float(4.69 * 1000), # us->ns
True,
float(0.001),
float(23 - 3.01029995664),
False,
True,
nargout=9,
background=False
)
end_time = datetime.now()
total_secs = (end_time - beg_time).total_seconds()
print(total_secs)
TOTAL_SEC += total_secs
print("Average:{}".format(TOTAL_SEC / TIMES))