简体   繁体   English

在python中读取.daq(用于Matlab的数据采集工具箱)文件格式

[英]Read .daq (Data Acquisition Toolbox for Matlab) file format in python

Anyone know of a way to read in .daq files generated with the Matlab Data Acquisition Toolbox in python? 任何人都知道一种读取用Matlab数据采集工具箱生成的.daq文件的方法吗? Alternatively, a simple way (using only open-source software) to convert the files to csv or .mat files which can be read by python would be ok. 另外,一种简单的方法(仅使用开源软件)可以将文件转换为可由python读取的csv或.mat文件。

I am not sure if you have solved this by now or not, but you can generate .mat files from the .daq files easily in matlab using daqread. 我不确定您是否已解决此问题,但是您可以使用daqread在matlab中轻松地从.daq文件生成.mat文件。 In the command window: 在命令窗口中:

Data = daqread(mydata.daq);
cd(saveDir)
save('Data','Data')

The Data variable is a .mat file. Data变量是.mat文件。 This can easily be added to a file directory scanning function. 可以轻松将其添加到文件目录扫描功能。 Reading into python is also straightforward using the scipy module. 使用scipy模块也可以直接读取python。 From the interpreter for example: 以解释器为例:

from scipy.io import loadmat
data = loadmat('Data.mat')

There may also be a .daq loading submodule somewhere in scipy, but you would have to look. 在scipy中的某个位置可能也有一个.daq加载子模块,但是您必须要看一下。

Hope this helps! 希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM