matlab 的计算效率 和 绘图速度要远快于 python3
matlab 默认的 绘图方式就是 x 为数组的索引值 y 为 数组的数值
python3 source code
import os
import matplotlib.pyplot as plt
import numpy as np
import struct
filename = "seq.bin"
file = open(filename, "rb")
st = os.stat("seq.bin")
print(f"seq.bin size {st.st_size}")
buf = file.read(st.st_size)
y = np.frombuffer(buf, dtype=np.uint16)
x = np.array(range(int(y.size/2)))
_y = []
for tmp in range(0, y.size, 2):
_y.append((y[tmp] | y[tmp+1] << 16))
fig, axes = plt.subplots()
axes.plot(x, _y)
plt.show()
matlab code
[file, message] = fopen("seq.bin", "rb");
if file < 0
disp(message);
else
disp("open ok");
end
[data, size] = fread(file, "uint32");
filename = "dbeug.txt";
plot(data);